Professional Documents
Culture Documents
Vmware Management With Vcli 5.0
Vmware Management With Vcli 5.0
0 Reference
PowerCLI Cmdlet
ESXCLI 5.0
Boot Options
Stateless PXE
ESXi
HA hostd
NTP DCUI
VM
vSphere Client
Move-VM Datastore Get-VMHostAdvancedConguration Set-VMHostAdvancedConguration Get-VMHostFirmware Set-VMHostFirmware Get-VMHostNetwork Set-VMHostNetwork Get-EsxCLI Get-VMHostFirewallDefaultPolicy Get-VMHostFirewallException Set-VMHostFirewallDefaultPolicy Set-VMHostFirewallException Get-VMHost Set-VMHost Restart-VMHost No equivalent Get-iScsiHBATarget New-iScsiHBATarget Set-iScsiHBATarget Remove-iScsiHBATarget Get-EsxCLI Get-ScsiLun Set-ScsiLun Get-ScsiLun Set-ScsiLun Get-Datastore New-Datastore Set-Datastore Get-VMHostNetworkAdapter Set-VMHostNetworkAdapter Get-VMHostNTPServer Set-VMHostNTPServer Get-VMHostStorage RescanAllHBA Set-VMHostNetwork Get-ScsiLun Set-ScsiLun Get-VMHostSNMP Set-VMHostSNMP Get-VMHostSysLogServer Set-VMHostSysLogServer Get-VMHostAccount Set-VMHostAccount New-VMHostAccount Remove-VMHostAccount Get-VMHostNetworkAdapter Set-VMHostNetworkAdapter Get-View needed to call APIs Get-VirtualSwitch Set-VirtualSwitch Get-VirtualPortGroup Set-VirtualPortgroup Copy-DatastoreItem PSDrives Install-VMHostPatch Install-VMHostPatch Get-HardDisk Copy-HardDisk Set-HardDisk Various cmdlets including: Get-VM Set-VM Get-Snapshot Set-Snapshot Get-VMGuestInfo Start-VM Stop-VM Restart-VM Get-EsxTop Get-VMHostPatch Install-VMHostPatch No equivalent No equivalent Multiple VM cmdlets available Get-Log
No equivalent esxcli system settings advanced No equivalent esxcli network ip dns server esxcli system coredump esxcli network rewall
User mode API (fuller POSIX subset) USB Resource Scheduling Distributed VM le system Storage Stack Virtual NIC & Switch Network Stack
VMM
PowerCLI
Upgrade to 4.x
fcoe
adapter nic
hardware
cpu bootdevice clock memory pci platform
iscsi
adapter networkportal physicalnetworkportal session ibftboot logicalnetworkportal plugin software
network
fence rewall ip vswitch nic
software
sources acceptance prole vib
storage
core nmp vmfs lesystem nfs
system
boot coredump module process secpolicy settings stats syslog visorfs hostname time uuid version welcomemsg
vm
process
SAN
VMkernel
New 5.0 Install Upgrade to 5.0 Using Update Manager Upgrade to 5.0 Using ESXi Installer
vMA/ESXCLI/ vCLI
vicfg-hostops
No equivalent
esxcfg-ipsec vicfg-ipsec esxcfg-swiscsi esxcfg-hwiscsi vicfg-iscsi esxcfg-module vicfg-module esxcfg-mpath vicfg-mpath vicfg-mpath35 esxcfg-nas vicfg-nas esxcfg-nics vicfg-nics vicfg-ntp esxcfg-rescan vicfg-rescan esxcfg-route vicfg-route esxcfg-scsidevs vicfg-scsidevs vicfg-snmp vicfg-syslog vicfg-user
Other Commands
Congure NTP
Add NTP Server (vCLI only)
# vicfg-ntp <conn_options> --add <ip address>
Network Commands
vSwitches
List Dened Standard Virtual Switches Add/Remove a vSwitch
# esxcli <conn_options> network vswitch standard list # esxcli <conn_options> network vswitch standard [add|remove] --vswitch-name <name>
Storage Commands
Scan Storage Devices VMFS
# esxcli <conn_options> storage core adapter rescan
esxcli system module esxcli storage core path No equivalent esxcli storage nfs
Remove NTP Server (vCLI only) Start NTP Service (vCLI only) List NTP Service (vCLI only)
# vicfg-ntp <conn_options> --delete <ip address> # vicfg-ntp <conn_options> --start # vicfg-ntp <conn_options> --start
# esxcli <conn_options> storage filesystem list # esxcli <conn_options> storage core device detached list
esxcli network nic No equivalent esxcli storage core No equivalent esxcli storage core esxcli storage core lesystem No equivalent esxcli system syslog No equivalent
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> -s register /vmfs/volumes/<volume name>/<vm>/<vm>.vmx <datacenter> <resource pool>
Users
Host Commands
Display host ESXi version Set the system time
# esxcli <conn_options> system version get # esxcli <conn_options> system time set --hour <16> --min <30> --sec <00>
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx getproductinfo platform
# esxcli <conn_options> network vswitch standard policy [ failover | security | shaping ] get
Mount a Datastore
# vicfg-user <conn_options> -e user o list # vicfg-user <conn_options> -e user o add l <user> -p <password>
Port Groups
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx getproductinfo product
NAS
Assign User Read Only Role (vCLI only) Remove User (vCLI only)
# vicfg-user <conn_options> -e user o modify l <user> --role read-only # vicfg-user <conn_options> -e user o delete l <user> -g <group>
# esxcli <conn_options> network vswitch standard portgroup [add|remove] --portgroup-name <portgroup> --vswitch-name <name>
# esxcli <conn_options> storage nfs list # esxcli <conn_options> storage nfs add -host=<FQHN> --share=/path/to/share --volume-name=<share name>
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx start [ soft | hard ]
Groups
# esxcli <conn_options> network vswitch standard portgroup policy failover set -active-uplinks=<uplink1, uplink2>
# esxcli <conn_options> system syslog config set --loghost=<ip address> # esxcli <conn_options> system syslog reload
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx stop [ soft | hard ]
# esxcli <conn_options> network vswitch standard portgroup set --portgroup-name <portgroup> --vlan-id=<vlanid>
iSCSI
# esxcli <conn_options> system coredump network set --interface-name <vmk#> --server-ipv4 <ip address> --server-port <portnumber> 6500 # esxcli <conn_options> system coredump network set --enable true
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx reset [ soft | hard ]
# esxcli <conn_options> iscsi software set -enabled=true # esxcli <conn_options> iscsi adapter list
Remove User from Group (vCLI only) Remove Group (vCLI only)
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx suspend [ soft | hard ]
# vicfg-user <conn_options> -e group o modify d <groupname> --removeuser <username> # vicfg-user <conn_options> -e group o delete d <groupname>
# esxcli <conn_options> network ip interface ipv4 set --interface-name=<vmk#> --ipv4=<ip address> --netmask<netmask> --type=static
# vicfg-authconfig --server=<ip address> --username=<user> --password=<password> --authscheme AD --joindomain <domainname> --adusername=<user> --adpassword=<password>
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx resume
Host Operations
Enter/Exit Maintenance Mode (vCLI only)
# vicfg-hostops <conn_options> --operation [enter | info | exit]
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx getuptime
# esxcli <conn_options> system coredump network set -interface-name vmk0 --server-ipv4=<ip address> --port=<port name> # esxcli <conn_options> system coredump network set -enabled=true # esxcli <conn_options> system coredump network get
# esxcli <conn_options> network ip interface list # esxcli <conn_options> network ip interface add -interface-name=<vmk#> --portgroup-name=<portgroup>
# esxcli <conn_options> iscsi adapter set -adapter=<iscsi adapter> --name=<name> # esxcli <conn_options> iscsi adapter set -adapter=<iscsi adapter> --alias=<alias> # esxcli <conn_options> iscsi adapter auth chap set -direction=mutual mchap_username=<name> --mchap_password=<pwd> --level=required --secret=<string> --adapter=<vmhba>
vmware-cmd
No equivalent
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx gettoolslastactive
0 = not installed/not running 1 = normal 5 = intermittent heartbeat 10 = no heartbeat
# esxcli <conn_options> system syslog config set -loghost=<ip address> # esxcli <conn_options> system syslog reload
Host Backup/Restore
No equivalent esxcli software vib No equivalent No equivalent No equivalent No equivalent
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/ volumes/<volume name>/<vm>/<vm>.vmx connectdevice <CD Drive>
# esxcli <conn_options> network ip interface ipv4 set -ip=<ip address> --netmask=<subnetmask> --interfacename=<vmk#>
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/ volumes/<volume name>/<vm>/<vm>.vmx disconnectdevice <CD Drive>
Managing Modules
List all modules
# esxcli <conn_options> system module list [--enabled=true]
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx createsnapshot <name> <desc> 0 0
Manage Routes
# vicfg-route <conn_options> <gateway> # vicfg-route <conn_options> -add <ip address> <netmask> <gateway>
Authentication
Setting up vMA FastPass
# vifp addserver <hostname> --username <user> --password <password> # viftptarget --set <hostname>
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx hassnapshot
0 = snapshot exists 1 = no snapshot
# vicfg-route <conn_options>
Congure DNS
Enable/Disable modules
# esxcli <conn_options> system hostname set --fdn=<hostname> # esxcli <conn_options> network ip dns server list
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx revertsnapshot
# vmware-cmd --server <vcenter ip> --vihost <ESXi host ip> /vmfs/volumes/<volume name>/<vm>/<vm>.vmx removesnapshot
# save_session --savesessionfile <file> --server <vcenter ip> --username <user> --password <pass>
# esxcli <conn_options> vm process list # esxcli <conn_options> vm process kill --type soft|hard|force --world-id <id>
# esxcli <conn_options> network ip dns server [add|remove] --domain=<domain> # esxcli <conn_options> network ip interface ipv4 set --interface-name=<vmk#> --type=dhcp # esxcli <conn_options> network ip interface ipv4 set -interface-name=<vmk#> --ipv4=<ip address> --netmask=<subnetmask> --type=static
C:\esxcli --server <vcenter ip> --passthroughauth --passthroughauthpackage Kerberos --vihost <hostname> network ip interface list
# VI_USERNAME=root <username>
# VI_PASSWORD=vmware123 <password>
ESXCLI connection options when connecting through vCenter Server: --server <vcenter ip> --vihost <ESXi host ip>
ESXCLI connection options when connecting directly to ESXi host: --server <ESXi host ip>