ESXI Esxcli VSphere Command-Line Interface Reference
ESXI Esxcli VSphere Command-Line Interface Reference
https://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.vsphere.scripting.doc_50%2FGUID-522DB42D-
78C1-4DD3-8708-E0AAA22B82BC.html
The vSphere CLI command set allows you to run common system administration commands against vSphere systems
from an administration server of your choice.
Linux Installation: If you accepted the defaults during installation, you can find the installed software in the following
locations:
Windows Installation: vSphere CLI commands are installed in C:\Program Files\VMware\VMware vSphere CLI\bin by
default.
The vSphere CLI includes the commands listed below, as well as the resxtop and esxcli commands.
Contents
Table 1: vSphere CLI commands ............................................................................................................................................. 2
esxcli command Commands ................................................................................................................................................... 3
esxcli fcoe Commands ............................................................................................................................................................ 3
esxcli hardware Commands .................................................................................................................................................... 3
esxcli iscsi Commands ............................................................................................................................................................. 4
esxcli license Commands ...................................................................................................................................................... 11
esxcli network Commands .................................................................................................................................................... 12
esxcli software Commands ................................................................................................................................................... 20
esxcli storage Commands ..................................................................................................................................................... 26
esxcli system Commands ...................................................................................................................................................... 39
esxcli vm Commands ............................................................................................................................................................ 43
svmotion ............................................................................................................................................................................... 44
vicfg-advcfg - query and modify advanced VMkernel options. Use when instructed by Technical Support. ...................... 46
vicfg-authconfig - manage Active Directory authentication schemes. ................................................................................. 48
vicfg-cfgbackup - back up and restore ESXi host configurations .......................................................................................... 49
vicfg-dns - configure DNS properties .................................................................................................................................... 51
vicfg-dumppart - query, set, and scan for diagnostic partitions on an ESX/ESXi system ..................................................... 52
vicfg-hostops - perform host-related operations. ................................................................................................................ 53
vicfg-ipsec - configure IPsec properties ................................................................................................................................ 55
vicfg-iscsi - manage iSCSI storage. ........................................................................................................................................ 58
vicfg-module - enable configuration of VMkernel module options ..................................................................................... 64
vicfg-mpath35 - configure multipath settings for Fibre Channel or iSCSI LUNs ................................................................... 65
vicfg-mpath - display path information, change path state ................................................................................................. 66
vicfg-nas - manipulate NAS file systems on an ESX/ESXi host. ............................................................................................. 68
vicfg-nics - get information, set speed and duplex for ESX/ESXi physical NICs .................................................................... 69
vicfg-ntp - configure the NTP server ..................................................................................................................................... 71
vicfg-rescan - scan the LUNs ................................................................................................................................................. 72
vicfg-route - get and set routing information for the VMkernel .......................................................................................... 73
vicfg-scsidevs - display information about available LUNs. .................................................................................................. 74
vicfg-snmp - configure the SNMP service ............................................................................................................................. 76
vicfg-syslog - get and set syslog server configuration .......................................................................................................... 77
vicfg-user - manage users and groups .................................................................................................................................. 78
vicfg-vmknic - configure virtual network adapters ............................................................................................................... 80
vicfg-volume - Managing LVM snapshot or replica volumes. ............................................................................................... 83
vicfg-vswitch - create and configure virtual switches and port groups ................................................................................ 84
vifs - perform file system operations on remote hosts ........................................................................................................ 87
vihostupdate35 - manage software installation packages on a VMware Infrastructure 3.5 host using vSphere CLI 4.0 and
later. ...................................................................................................................................................................................... 89
vihostupdate - manage software installation packages on an ESX/ESXi host. ..................................................................... 90
vmkfstools - vSphere CLI for managing VMFS volumes........................................................................................................ 92
vmware-cmd - perform virtual machine operations ............................................................................................................ 95
To display usage information, click the command name in the Documentation column of Table 1.
Table 1: vSphere CLI commands
Documentation Description
esxcli command Lists descriptions of esxcli commands.
esxcli fcoe FCOE (Fibre Channel over Ethernet) comands
esxcli hardware Hardware namespace. Used primarily for extracting information about the current system setup.
esxcli iscsi iSCSI namespace for minitoring and managing hardware and software iSCSI.
esxcli license License management commands.
esxcli network Network namespace for managing virtual networking including virtual switches and VMkernel network
interfaces.
esxcli software Software namespace. Includes commands for managing and installing image profiles and VIBs.
esxcli storage Includes core storage commands and other storage management commands.
esxcli system System monitoring and management command.
esxcli vm Namespace for listing virtual machines and shutting them down forcefully.
svmotion Moves a virtual machine's configuration file and optionally its disks while the virtual machine is
running. Must run against a vCenter Server system.
vicfg-advcfg Performs advanced configuration including enabling and disabling CIM providers. Use this command
as instructed by VMware.
vicfg- Manages Active Directory authentication.
authconfig
vicfg-cfgbackup Backs up the configuration data of an ESXi system and restores previously saved configuration data.
vicfg-dns.pl Specifies an ESX/ESXi host's DNS (Domain Name Server) configuration.
vicfg-dumppart Manages diagnostic partitions.
vicfg-hostops Allows you to start, stop, and examine ESX/ESXi hosts and to instruct them to enter maintenance
mode and exit from maintenance mode.
vicfg-ipsec Supports setup of IPSec.
vicfg-iscsi Manages iSCSI storage.
vicfg-module Enables VMkernel options. Use this command with the options listed, or as instructed by VMware.
vicfg-mpath Displays information about storage array paths and allows you to change a path's state.
vicfg-mpath35 Configures multipath settings for Fibre Channel or iSCSI LUNs.
vicfg-nas Manages NAS file systems.
vicfg-nics Manages the ESX/ESXi host's NICs (uplink adapters).
vicfg-ntp Specifies the NTP (Network Time Protocol) server.
vicfg-rescan Rescans the storage configuration.
vicfg-route Lists or changes the ESX/ESXi host's route entry (IP gateway).
vicfg-scsidevs Finds available LUNs.
vicfg-snmp Manages the Simple Network Management Protocol (SNMP) agent.
vicfg-syslog Specifies the syslog server and the port to connect to that server for ESXi hosts.
vicfg-user Creates, modifies, deletes, and lists local direct access users and groups of users.
vicfg-vmknic Adds, deletes, and modifies virtual network adapters (VMkernel NICs).
vicfg-volume Supports resignaturing a VMFS snapshot volume and mounting and unmounting the snapshot volume.
vicfg-vswitch Adds or removes virtual switches or vNetwork Distributed Switches, or modifies switch settings.
vifs.pl Performs file system operations such as retrieving and uploading files on the remote server.
vihostupdate Manages updates of ESX/ESXi hosts. Use vihostupdate35 for ESXi 3.5 hosts.
vihostupdate35 Manages updates of ESX/ESXi version 3.5 hosts.
vmkfstools Creates and manipulates virtual disks, file systems, logical volumes, and physical storage devices on
ESX/ESXi hosts.
vmware-cmd Performs virtual machine operations remotely. This includes, for example, creating a snapshot,
powering the virtual machine on or off, and getting information about the virtual machine.
network
Load ruleset configuration --help | -h
firewall
refresh for firewall. Show the help message.
--help | -h
network Show the help message.
firewall Add allowed ip
--ip-address | -i
ruleset address/range to the
allowedip
Allowed ip address/range for the ruleset.
ruleset ruleset. --ruleset-id | -r
add
The label of the ruleset.
network --help | -h
firewall
list allowed ip addresses Show the help message.
ruleset
for rulesets. --ruleset-id | -r
allowedip
list The label of the ruleset.
--help | -h
network Show the help message.
firewall Remove allowed ip
--ip-address | -i
ruleset address/range from the
allowedip
Allowed ip address/range for the ruleset.
ruleset. --ruleset-id | -r
remove
The label of the ruleset.
--help | -h
network
List the rulesets in Show the help message.
firewall
firewall. --ruleset-id | -r
ruleset list
List configuration for specfic ruleset
network --help | -h
List the rules of each
firewall Show the help message.
ruleset rule ruleset in firewall. --ruleset-id | -r
list List rules for specfic ruleset
--allowed-all | -a
Set to true to allowed all ip, set to false to use allowed ip list.
--enabled | -e
network Set firewall ruleset status
Set to true to enable ruleset, set to false to disable it.
firewall (allowedAll flag and --help | -h
ruleset set enabled status). Show the help message.
--ruleset-id | -r
The label of the ruleset.
--default-action | -d
Set to true to set defaultaction PASS, set to false to DROP.
network Set firewall enabled status --enabled | -e
firewall set and default action. Set to true to enable the firewall, set to false to disable the firewall.
--help | -h
Show the help message.
network
Allow unload firewall --help | -h
firewall
unload module. Show the help message.
--help | -h
network ip
List active TCP/IP Show the help message.
connection
connections --type | -t
list
Connection type : [ip, tcp, udp, all]
Add a search domain to
--domain | -d
network ip the list of domains to be
The string name of a domain to add to the list of search domains.
dns search searched when trying to --help | -h
add resolve an host name on Show the help message.
the ESXi host.
List the search domains
network ip currently configured on
--help | -h
dns search the ESXi host in the order
list
Show the help message.
in which they will be used
when searching.
Remove a search domain --domain | -d
network ip from the list of domains to The string name of a domain to remove from the list of search
dns search be searched when trying domains.
remove to resolve an host name --help | -h
on the ESXi host. Show the help message.
--help | -h
Add a new DNS server to
network ip Show the help message.
the end of the list of DNS --server | -s
dns server
add servers to use for this ESXi The IP address (v4 or v6) of the DNS server to add to the DNS server
host. list.
Print a list of the DNS
network ip server currently
--help | -h
dns server configured on the system
list Show the help message.
in the order in which they
will be used.
Remove a DNS server --all | -a
network ip
from the list of DNS --help | -h
dns server
remove servers to use for this ESXi Show the help message.
host. --server | -s
network ip --help | -h
get
Get global IP settings Show the help message.
network ip Add a new VMkernel --help | -h
interface network interface. Show the help message.
add --interface-name | -i
The name of the VMkernel network interface to create. This name
must be in the form vmkX, where X is a number 0-99
--mac-address | -M
Set the MAC address for the newly created VMkernel network
interface.
--mtu | -m
Set the MTU setting for a given VMkernel network interface on
creation
--portgroup-name | -p
The name of the port group to add this VMkernel network interface
to. This option is required.
--help | -h
network ip Get IPv4 settings for Show the help message.
interface VMkernel network --interface-name | -i
ipv4 get interfaces. The name of the VMkernel network interface to limit the output of
this command to.
--help | -h
Show the help message.
--interface-name | -i
The name of the VMkernel network interface to set IPv4 settings
for. This name must be an interface listed in the interface list
command.
--ipv4 | -I
The static IPv4 address for this interface.
network ip Configure IPv4 setting for --netmask | -N
interface a given VMkernel network The static IPv4 netmask for this interface.
ipv4 set interface. --peer-dns | -P
A boolean value to indicate if the system should use the DNS
settings published via DHCP for this interface.
--type | -t
IPv4 Address type : dhcp: Use DHCP to aquire IPv4 setting for this
interface. none: Remove IPv4 settings form this interface. static: Set
Static IPv4 information for this interface. Requires --ipv4 and --
netmask options.
--help | -h
Show the help message.
--interface-name | -i
network ip Add a static IPv6 address The name of the VMkernel network interface to add a static IPv6
interface
to a given VMkernel address to. This name must be an interface listed in the interface
ipv6 address
add network interface. list command.
--ipv6 | -I
The IPv6 address to add to the given VMkernel network interface.
This must be in X:X:X::/X format
network --help | -h
vswitch Get the failover policy Show the help message.
standard settings governing the --vswitch-name | -v
policy given virtual switch The name of the virtual switch to use when fetching the switch
failover get failover policy.
--active-uplinks | -a
Configure the list of active adapters and their failover order. This
list must be a comma seperated list of values with the uplink name
and no spaces. Example: --active-
uplinks=vmnic0,vmnic3,vmnic7,vmnic1
--failback | -b
Configure whether a NIC will be used immediately when it comes
back in service after a failover
--failure-detection | -f
Set the method of determining how a network outage is detected.
beacon: Detect failures based on active beaconing to the vswitch
link: Detect failures based on the NIC link state
--help | -h
Show the help message.
network --load-balancing | -l
vswitch Set the load balancing policy for this policy. This can be one of the
Configure the Failover
standard
policy for a virtual switch. following options: explicit: Always use the highest order uplink from
policy
failover set the list of active adapters which pass failover criteria. iphash: Route
based on hashing the src and destination IP addresses mac: Route
based on the MAC address of the packet source. portid: Route
based on the originating virtual port ID.
--notify-switches | -n
Indicate whether to send a notification to physical switches on
failover
--standby-uplinks | -s
Configure the list of standby adapters and their failover order. This
list must be a comma seperated list of values with the uplink name
and no spaces. Example: --standby-
uplinks=vmnic2,vmnic4,vmnic8,vmnic6,vmnic11
--vswitch-name | -v
The name of the virtual switch to use when configuring the switch
failover policy.
network --help | -h
vswitch Get the Security Policy Show the help message.
standard governing the given virtual --vswitch-name | -v
policy switch. The name of the virtual switch to use when fetching the network
security get security policy.
--allow-forged-transmits | -f
Allow ports on the virtual switch to send packets with forged
source information.
--allow-mac-change | -m
network Allow ports on the virtual switch to change their MAC address.
vswitch Set the security policy for --allow-promiscuous | -p
standard
policy a given virtual switch Allow ports on the virtual switch to enter promiscuous mode.
security set --help | -h
Show the help message.
--vswitch-name | -v
The name of the virtual switch to use when setting the switch
security policy.
network --help | -h
vswitch
Get the shaping policy Show the help message.
standard settings for the given --vswitch-name | -v
policy The name of the virtual switch to use when fetching the switch
shaping get
virtual switch
shaping policy.
--avg-bandwidth | -b
The averge bandwidth allowed for this shaping policy. This value is
in Kbps (1 Kbps = 1000 bits/s)
--burst-size | -t
The largest burst size allowed for this shaping policy. This value is in
Kib (1 Kib = 1024 bits)
--enabled | -e
network Indicate whether to enable traffic shaping on this policy. If this is
vswitch Set the shaping policy
true then the --avg-bandwidth, --peak-bandwidth and --burst-size
standard settings for the given
policy options are required.
virtual switch --help | -h
shaping set
Show the help message.
--peak-bandwidth | -k
The peak bandwidth allowed for this shaping policy. This value is in
Kbps (1 Kbps = 1000 bits/s)
--vswitch-name | -v
The name of the virtual switch to use when setting the switch
shaping policy.
--help | -h
network Show the help message.
vswitch Allows the addition of a
--portgroup-name | -p
standard standard port group to a
portgroup
The name of the port group to add
virtual switch. --vswitch-name | -v
add
The virtual switch to add the port group to.
network
vswitch List all of the port groups --help | -h
standard
portgroup currently on the system. Show the help message.
list
network --help | -h
vswitch Get the network failover Show the help message.
standard --portgroup-name | -p
portgroup
policy settings governing
policy the given port group The name of the port group to use when fetching the port group
failover get failover policy.
--active-uplinks | -a
Configure the list of active adapters and their failover order. This
list must be a comma seperated list of values with the uplink name
and no spaces. Example: --active-
uplinks=vmnic0,vmnic3,vmnic7,vmnic1
--failback | -b
Configure whether a NIC will be used immediately when it comes
back in service after a failover
--failure-detection | -f
network Configure the Failover
vswitch Set the method of determining how a network outage is detected.
policy for a port group.
standard beacon: Detect failures based on active beaconing to the vswitch
portgroup
These setting may
link: Detect failures based on the NIC link state
policy potentially override virtual --help | -h
failover set switch settings. Show the help message.
--load-balancing | -l
Set the load balancing policy for this policy. This can be one of the
following options: explicit: Always use the highest order uplink from
the list of active adapters which pass failover criteria. iphash: Route
based on hashing the src and destination IP addresses mac: Route
based on the MAC address of the packet source. portid: Route
based on the originating virtual port ID.
--notify-switches | -n
Indicate whether to send a notification to physical switches on
failover
--portgroup-name | -p
The name of the port group to set failover policy for.
--standby-uplinks | -s
Configure the list of standby adapters and their failover order. This
list must be a comma seperated list of values with the uplink name
and no spaces. Example: --standby-
uplinks=vmnic2,vmnic4,vmnic8,vmnic6,vmnic11
--use-vswitch | -u
Reset all values for this policy to use parent virtual switch's settings
instead of overriding the settings for the port group. Using this in
conjunction with other settings will first reset all of the fields to use
the virtual switch setting and then apply the other options after the
reset.
network --help | -h
vswitch Get the Security Policy Show the help message.
standard --portgroup-name | -p
portgroup
governing the given port
policy group. The name of the port group to use when fetching the network
security get security policy.
--allow-forged-transmits | -f
Allow ports on the virtual switch to send packets with forged
source information.
--allow-mac-change | -m
Allow ports on the virtual switch to change their MAC address.
--allow-promiscuous | -o
network Allow ports on the virtual switch to enter promiscuous mode.
vswitch --help | -h
standard Set the security policy for Show the help message.
portgroup a given port group --portgroup-name | -p
policy
security set
The name of the port group to set security policy for.
--use-vswitch | -u
Reset all values for this policy to use parent virtual switch's settings
instead of overriding the settings for the port group. Using this in
conjunction with other settings will first reset all of the fields to use
the virtual switch setting and then apply the other options after the
reset.
network --help | -h
vswitch Get the network shaping Show the help message.
standard --portgroup-name | -p
portgroup
policy settings governing
policy the given port group The name of the port group to use when fetching the port group
shaping get shaping policy.
--avg-bandwidth | -b
The averge bandwidth allowed for this shaping policy. This value is
in Kbps (1 Kbps = 1000 bits/s)
--burst-size | -t
The largest burst size allowed for this shaping policy. This value is in
Kib (1 Kib = 1024 bits)
network --enabled | -e
vswitch Set the shaping policy Indicate whether to enable traffic shaping on this policy. If this is
standard
portgroup settings for the given port true then the --avg-bandwidth, --peak-bandwidth and --burst-size
policy group options are required.
shaping set --help | -h
Show the help message.
--peak-bandwidth | -k
The peak bandwidth allowed for this shaping policy. This value is in
Kbps (1 Kbps = 1000 bits/s)
--portgroup-name | -p
The name of the port group to set shaping policy for.
--use-vswitch | -u
Reset all values for this policy to use parent virtual switch's settings
instead of overriding the settings for the port group. Using this in
conjunction with other settings will first reset all of the fields to use
the virtual switch setting and then apply the other options after the
reset.
network --help | -h
vswitch
Remove a port group from Show the help message.
standard
portgroup the given virtual switch --portgroup-name | -p
remove --vswitch-name | -v
--help | -h
network Show the help message.
vswitch
Set the vlan id for the --portgroup-name | -p
standard
portgroup given port group The name of the port group to set vlan id for.
set --vlan-id | -v
The vlan id for this port group. This value is in the range (0 - 4095)
network --help | -h
Remove a virtual switch
vswitch Show the help message.
standard
from the ESXi networking --vswitch-name | -v
remove system. The name of the virtual switch to remove.
--cdp-status | -c
The CDP status of the given virtual switch. It can be 'down', 'listen',
'advertise' or 'both'
network This command sets the --help | -h
vswitch MTU size and CDP status Show the help message.
standard set of a given virtual switch. --mtu | -m
The MTU size of the given virtual switch.
--vswitch-name | -v
The name of virtual switch to apply the configurations.
Add an uplink to the given
virtual switch. Note if this --help | -h
network virtual switch has a NIC Show the help message.
vswitch teaming policy assigned to --uplink-name | -u
standard it then the policy must The name of the uplink to add to the virtual switch.
uplink add
also be modified to enable --vswitch-name | -v
use of this uplink on this The name of the virtual switch to add an uplink to.
virtual switch
Remove an uplink from
the given virtual switch.
Note if this virtual switch --help | -h
network Show the help message.
vswitch has a NIC teaming policy
--uplink-name | -u
standard assigned to it then the
uplink
The name of the uplink to remove from the virtual switch.
policy must also be --vswitch-name | -v
remove
modified to disable use of The name of the virtual switch to remove an uplink from.
this uplink on this virtual
switch
software --help | -h
Sets the host acceptance level. This controls
acceptance Show the help message.
set what VIBs will be allowed on a host. --level
Specifies the acceptance level to set. Should be
one of certified / accepted / partner /
community.
--help | -h
Show the help message.
--pending
Displays information for the ESXi image which
software Display the installed image profile and host becomes active after a reboot, or nothing if
profile get acceptance level. the pending-reboot image has not been
created yet. If not specified, information from
the current ESXi image in memory will be
returned.
--depot | -d
Specifies full remote URLs of the depot
index.xml or server file path pointing to an
offline bundle .zip file.
--dry-run
Performs a dry-run only. Report the VIB-level
operations that would be performed, but do
not change anything in the system.
--force | -f
Bypasses checks for package dependencies,
conflicts, obsolescence, and acceptance levels.
Really not recommended unless you know
what you are doing. Use of this option will
result in a warning being displayed in the
vSphere Client.
--help | -h
Show the help message.
--maintenance-mode
Pretends that maintenance mode is in effect.
Installs or applies an image profile from a depot
Otherwise, installation will stop for live installs
to this host. This command completely replaces
that require maintenance mode. This flag has
the installed image with the image defined by
software no effect for reboot required remediations.
the new image profile, and may result in the --no-live-install
profile
install loss of installed VIBs. To preserve installed VIBs, Forces an install to /altbootbank even if the
use profile update instead. WARNING: If your VIBs are eligible for live installation or removal.
installation requires a reboot, you need to Will cause installation to be skipped on PXE-
disable HA first. booted hosts.
--no-sig-check
Bypasses acceptance level verification,
including signing. Use of this option poses a
large security risk and will result in a SECURITY
ALERT warning being displayed in the vSphere
Client.
--ok-to-remove
Allows the removal of installed VIBs as part of
applying the image profile. If not specified,
esxcli will error out if applying the image
profile results in the removal of installed VIBs.
--profile | -p
Specifies the name of the image profile to
install.
--proxy
Specifies a proxy server to use for HTTP, FTP,
and HTTPS connections. The format is proxy-
url:port.
software
profile
Updates the host with VIBs from an image --allow-downgrades
update profile in a depot. Installed VIBs may be If this option is specified, then the VIBs from
upgraded (or downgraded if --allow- the image profile which update, downgrade, or
downgrades is specified), but they will not be are new to the host will be installed. If the
removed. Any VIBs in the image profile which option is not specified, then the VIBs which
are not related to any installed VIBs will be update or are new to the host will be installed.
added to the host. WARNING: If your --depot | -d
installation requires a reboot, you need to Specifies full remote URLs of the depot
disable HA first. index.xml or server file path pointing to an
offline bundle .zip file.
--dry-run
Performs a dry-run only. Report the VIB-level
operations that would be performed, but do
not change anything in the system.
--force | -f
Bypasses checks for package dependencies,
conflicts, obsolescence, and acceptance levels.
Really not recommended unless you know
what you are doing. Use of this option will
result in a warning being displayed in the
vSphere Client.
--help | -h
Show the help message.
--maintenance-mode
Pretends that maintenance mode is in effect.
Otherwise, installation will stop for live installs
that require maintenance mode. This flag has
no effect for reboot required remediations.
--no-live-install
Forces an install to /altbootbank even if the
VIBs are eligible for live installation or removal.
Will cause installation to be skipped on PXE-
booted hosts.
--no-sig-check
Bypasses acceptance level verification,
including signing. Use of this option poses a
large security risk and will result in a SECURITY
ALERT warning being displayed in the vSphere
Client.
--profile | -p
Specifies the name of the image profile to
update the host with.
--proxy
Specifies a proxy server to use for HTTP, FTP,
and HTTPS connections. The format is proxy-
url:port.
--depot | -d
Specifies full remote URLs of the depot
index.xml or server file path pointing to an
offline bundle .zip file.
--help | -h
software Show the help message.
Validates the current image profile on the host --profile | -p
profile
validate against an image profile in a depot. Specifies the name of the image profile to
validate the host with.
--proxy
Specifies a proxy server to use for HTTP, FTP,
and HTTPS connections. The format is proxy-
url:port.
software Display details about an image profile from the --depot | -d
sources depot. Specifies full remote URLs of the depot
profile get
index.xml or server file path pointing to an
offline bundle .zip file.
--help | -h
Show the help message.
--profile | -p
Specifies the name of the image profile to
display.
--proxy
Specifies a proxy server to use for HTTP, FTP,
and HTTPS connections. The format is proxy-
url:port.
--depot | -d
Specifies full remote URLs of the depot
index.xml or server file path pointing to an
software offline bundle .zip file.
sources --help | -h
profile
List all the image profiles in a depot. Show the help message.
list --proxy
Specifies a proxy server to use for HTTP, FTP,
and HTTPS connections. The format is proxy-
url:port.
--depot | -d
Specifies full remote URLs of the depot
index.xml or server file path pointing to an
offline bundle .zip file.
--help | -h
Show the help message.
--proxy
Specifies a proxy server to use for HTTP, FTP,
and HTTPS connections. The format is proxy-
software url:port.
Displays detailed information about one or --vibname | -n
sources vib
get more VIB packages in the depot Specifies one or more VIBs in the depot to
display more information about. If this option
is not specified, then all of the VIB packages
from the depot will be displayed. Must be one
of the following forms: name, name:version,
vendor:name, or vendor:name:version.
--viburl | -v
Specifies one or more URLs to VIB packages to
display information about. http:, https:, ftp:,
and file: are all supported.
--depot | -d
Specifies full remote URLs of the depot
index.xml or server file path pointing to an
offline bundle .zip file.
software --help | -h
sources vib List all the VIBs from depots.
list
Show the help message.
--proxy
Specifies a proxy server to use for HTTP, FTP,
and HTTPS connections. The format is proxy-
url:port.
--help | -h
Show the help message.
software Displays detailed information about one or --pending
vib get more installed VIBs Displays information for the ESXi image which
becomes active after a reboot, or nothing if
the pending-reboot image has not been
created yet. If not specified, information from
the current ESXi image in memory will be
returned.
--vibname | -n
Specifies one or more installed VIBs to display
more information about. If this option is not
specified, then all of the installed VIBs will be
displayed. Must be one of the following forms:
name, name:version, vendor:name, or
vendor:name:version.
--depot | -d
Specifies full remote URLs of the depot
index.xml or server file path pointing to an
offline bundle .zip file.
--dry-run
Performs a dry-run only. Report the VIB-level
operations that would be performed, but do
not change anything in the system.
--force | -f
Bypasses checks for package dependencies,
conflicts, obsolescence, and acceptance levels.
Really not recommended unless you know
what you are doing. Use of this option will
result in a warning being displayed in the
vSphere Client.
--help | -h
Show the help message.
--maintenance-mode
Pretends that maintenance mode is in effect.
Otherwise, installation will stop for live installs
that require maintenance mode. This flag has
Installs VIB packages from a URL or depot. VIBs
no effect for reboot required remediations.
software may be installed, upgraded, or downgraded. --no-live-install
vib install WARNING: If your installation requires a reboot, Forces an install to /altbootbank even if the
you need to disable HA first. VIBs are eligible for live installation or removal.
Will cause installation to be skipped on PXE-
booted hosts.
--no-sig-check
Bypasses acceptance level verification,
including signing. Use of this option poses a
large security risk and will result in a SECURITY
ALERT warning being displayed in the vSphere
Client.
--proxy
Specifies a proxy server to use for HTTP, FTP,
and HTTPS connections. The format is proxy-
url:port.
--vibname | -n
Specifies VIBs from a depot, using one of the
following forms: name, name:version,
vendor:name, or vendor:name:version.
--viburl | -v
Specifies one or more URLs to VIB packages to
install. http:, https:, ftp:, and file: are all
supported.
--help | -h
software Show the help message.
vib list
Lists the installed VIB packages --pending
Displays information for the ESXi image which
becomes active after a reboot, or nothing if
the pending-reboot image has not been
created yet. If not specified, information from
the current ESXi image in memory will be
returned.
--dry-run
Performs a dry-run only. Report the VIB-level
operations that would be performed, but do
not change anything in the system.
--force | -f
Bypasses checks for package dependencies,
conflicts, obsolescence, and acceptance levels.
Really not recommended unless you know
what you are doing. Use of this option will
result in a warning being displayed in the
vSphere Client.
--help | -h
Removes VIB packages from the host. Show the help message.
software
vib remove
WARNING: If your installation requires a reboot, --maintenance-mode
you need to disable HA first. Pretends that maintenance mode is in effect.
Otherwise, remove will stop for live removes
that require maintenance mode. This flag has
no effect for reboot required remediations.
--no-live-install
Forces an remove to /altbootbank even if the
VIBs are eligible for live removal. Will cause
installation to be skipped on PXE-booted hosts.
--vibname | -n
Specifies one or more VIBs on the host to
remove. Must be one of the following forms:
name, name:version, vendor:name,
vendor:name:version.
--depot | -d
Specifies full remote URLs of the depot
index.xml or server file path pointing to an
offline bundle .zip file.
--dry-run
Performs a dry-run only. Report the VIB-level
operations that would be performed, but do
not change anything in the system.
--force | -f
Bypasses checks for package dependencies,
conflicts, obsolescence, and acceptance levels.
Really not recommended unless you know
Update installed VIBs to newer VIB packages.
what you are doing. Use of this option will
software No new VIBs will be installed, only updates.
vib update
result in a warning being displayed in the
WARNING: If your installation requires a reboot,
vSphere Client.
you need to disable HA first. --help | -h
Show the help message.
--maintenance-mode
Pretends that maintenance mode is in effect.
Otherwise, installation will stop for live installs
that require maintenance mode. This flag has
no effect for reboot required remediations.
--no-live-install
Forces an install to /altbootbank even if the
VIBs are eligible for live installation or removal.
Will cause installation to be skipped on PXE-
booted hosts.
--no-sig-check
Bypasses acceptance level verification,
including signing. Use of this option poses a
large security risk and will result in a SECURITY
ALERT warning being displayed in the vSphere
Client.
--proxy
Specifies a proxy server to use for HTTP, FTP,
and HTTPS connections. The format is proxy-
url:port.
--vibname | -n
Specifies VIBs from a depot, using one of the
following forms: name, name:version,
vendor:name, or vendor:name:version. VIB
packages which are not updates will be
skipped.
--viburl | -v
Specifies one or more URLs to VIB packages to
update to. http:, https:, ftp:, and file: are all
supported. VIB packages which are not
updates will be skipped.
storage
List the volumes available to the host. This --help | -h
filesystem
list includes VMFS, NAS and VFAT partitions. Show the help message.
--help | -h
Show the help message.
--no-persist | -n
Mount the volume non-peristently; the
volume will not be mounted after a restart.
storage --volume-label | -l
Connect to and mount an unmounted volume The label of the volume to mount. This
filesystem
mount on the ESX host. volume must be unmounted for this
operation to succeed.
--volume-uuid | -u
The UUID of the VMFS filesystem to mount.
This volume must be unmounted for this
operation to succeed.
--enable | -e
Enable network dump.
--help | -h
Show the help message.
system --interface-name | -v
Set the parameters used for network core An active interface to be used for the network core
coredump
network set dump dump.
--server-ipv4 | -i
IP address of the core dump server.
--server-port | -o
Port on which the core dump server is listening.
Get one of the dump partition configured
system values. This command will print either the
coredump --help | -h
partition active dump partition or the configured Show the help message.
get dump partition depending on the flags
passed.
List all of the partitions on the system that
system have a partition type matching the
coredump VMware Core partition type. Also indicate --help | -h
partition which partition, if any, is being used as Show the help message.
list
the system's dump partition and which is
configured to be used at next boot.
--enable | -e
Enable or disable the VMkernel dump partition.
--help | -h
Show the help message.
Set the specific VMkernel dump partition --partition | -p
system for this system. This will configure the The name of the partition to use. This should be a
coredump
dump partition for the next boot. This device name with a partition number at the end.
partition
set command will change the active dump Example: naa.xxxxx:1
partition to the partition specified. --smart | -s
If --enable=true, this flag will cause the best
available partition to be selected using the smart
selection algorithm.
--unconfigure | -u
Set the dump partition into an unconfigured state.
This will remove the current configured dump
partition for the next boot. This will result in the
smart activate algorithm being used at the next
boot.
system Get the host, domain or fully qualified --help | -h
hostname get name of the ESX host. Show the help message.
--domain | -d
The domain name to set for the ESX host. This
option is mutually exclusive with the --fqdn option.
--fqdn | -f
Set the fully qualified domain name of the ESX host.
--help | -h
This command allows the user to set the Show the help message.
system
hostname set
hostname, domain name or fully qualified --host | -H
domain name of the ESX host. The host name to set for the ESX host. This name
should not contain the DNS domain name of the
host and can only contain letters, numbers and '-'.
NOTE this is not the fully qualified name, that can
be set with the --fqdn option. This option is
mutually exclusive with the --fqdn option.
--help | -h
Show the help message.
system Show the ELF header information for the --module | -m
module get given VMkernel module. The name of the VMkernel module to get the
option string for.
--enabled | -e
List the enabled / disabled VMkernel modules and
device drivers.
system List the VMkernel modules that the --help | -h
module list system knows about. Show the help message.
--loaded | -l
List the loaded / not loaded VMkernel modules and
device drivers.
--force | -f
Load a VMkernel module with the given Ignore the enabled/disabled state of this module
name if it is enabled. If the module is and force it to load.
system
--help | -h
module load disabled then the use of --force is Show the help message.
required to load the module. --module | -m
The name of the VMkernel module to load.
--help | -h
system List the parameters, a descriptions of each
Show the help message.
module parameter supported for a given module --module | -m
parameters name and the user defined value for each
list
The name of the VMkernel module to get the
parameter. option string for.
--force | -f
Skip VMkernel module validity checks and set
parameters for a module (or alias) with the given
name.
system --help | -h
module Set the load time parameters for the
parameters
Show the help message.
given VMkernel module. --module | -m
set
The name of the VMkernel module to set
parameters for.
--parameter-string | -p
The string containing the parameters for this
module.
--enabled | -e
Set to true to enable the module, set to false to
disable the module.
--force | -f
Skip VMkernel module validity checks and set
system Allow enabling and disabling of a
module set
options for a module (or alias) with the given name.
VMkernel module. --help | -h
Show the help message.
--module | -m
The name of the VMkernel module to set options
for.
system List the VMkernel UserWorld processes --help | -h
process list currently on the host. Show the help message.
system
process System load average over the last 1, 5 and --help | -h
stats load 15 minutes. Show the help message.
get
system
process --help | -h
stats
Number of currently running processes. Show the help message.
running get
system
List the enforcement level for each --help | -h
secpolicy
domain list domain. Show the help message.
--all-domains | -a
All domains.
Set the enforcement level for a domain in --help | -h
system
the system. Any option specified here is Show the help message.
secpolicy
not persistent and will not survive a --level | -l
domain set
reboot of the system. The enforcement level.
--name | -n
The domain name.
--help | -h
Show the help message.
system --tree | -t
settings List the advanced options available from Limit the list of advanced option to a specific sub
advanced the VMkernel. tree.
list --option | -o
Only get the information for a single advanced
option.
--default | -d
Reset the option to its default value.
--help | -h
Show the help message.
system --int-value | -i
settings Set the value of an advanced option. If the option is an integer value use this option.
advanced set --option | -o
The name of the option to set the value of.
Example: " /Misc/HostName"
--string-value | -s
If the option is a string use this option.
system --help | -h
settings List VMkernel kernel settings.
kernel list
Show the help message.
--help | -h
system
Show the help message.
settings Set a VMKernel setting. --setting | -s
kernel set
The name of the VMKernel setting to set.
--value | -v
The value to set the setting to.
system stats Disply the number of microseconds the --help | -h
uptime get system has been running. Show the help message.
system
Show the current global configuration --help | -h
syslog
config get values Show the help message.
system
syslog --help | -h
config
Show the currently configured sub-loggers Show the help message.
logger list
--help | -h
Show the help message.
--id
The id of the logger to configure
system --reset
syslog Set configuration options for a specific Reset values to default
config sub-logger --rotate
logger set Number of rotated logs to keep for a specific logger
(requires --id)
--size
Set size of logs before rotation for a specific logger,
in KiB (requires --id)
--default-rotate
Default number of rotated logs to keep
--default-size
Default size of logs before rotation, in KiB
--help | -h
Show the help message.
system --logdir
syslog Set global log configuration options The directory to output logs to
config set --logdir-unique
Place logs in a unique subdirectory of logdir, based
on hostname
--loghost
The remote host to output logs to
--reset
Reset values to default
--help | -h
system Show the help message.
syslog mark
Mark all logs with the specified string --message | -s
The message to place in the logs
system
Reload the log daemon to apply any new --help | -h
syslog
reload configuration options Show the help message.
system --help | -h
visorfs Remove a Visorfs RAM disk from the ESXi Show the help message.
ramdisk Host. --target | -t
remove Mountpoint for the ramdisk
system --help | -h
visorfs List the tardisks used by the host.
tardisk list
Show the help message.
system --help | -h
welcomemsg Get the Welcome Message for DCUI.
get
Show the help message.
--help | -h
system
Show the help message.
welcomemsg Set the Welcome Message for DCUI. --message | -m
set
Welcome Message String.
esxcli vm Commands
svmotion
• NAME
• SYNOPSIS
• DESCRIPTION
o Interactive Mode
o Noninteractive Mode
• OPTIONS
• EXAMPLES
NAME
SYNOPSIS
svmotion <connection_options> --interactive
svmotion <connection_options>
--datacenter=<datacenter name>
--vm <VM config datastore path>:
<new datastore name>
[--disks <virtual disk datastore path>:
<new datastore>,
<virtual disk datastore path>:
<new datastore>]
DESCRIPTION
The svmotion command moves a virtual machine's configuration file, and, optionally, its disks, while the virtual machine
is running. The Basic System Administration manual discusses how to use svmotion. You can use svmotion to initiate
migrations for virtual machines running on either ESX or ESXi hosts.
When you run svmotion, --server must point to a vCenter Server system.
The --vm option specifies the virtual machine and its destination. By default, svmotion relocates all virtual disks to the
same datastore as the virtual machine. Use the --disks option to relocate individual virtual disks to different datastores.
You cannot relocate a virtual disk without relocating the virtual machine configuration file.
The svmotion command supports both interactive or noninteractive mode.
Interactive Mode
To use the command in interactive mode, type svmotion --interactive. The command prompts you for the information
necessary to complete the storage migration. Use quotes around special characters on Windows systems.
When you specify --interactive, all other options are ignored.
Noninteractive Mode
connection_options
Specifies the target server and authentication information if required. Run svmotion with --help for a list of all
connection options.
In non-interactive mode, all vCLI common options are supported. In interactive mode, command-line options
are ignored and svmotion uses user input instead.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--usage
Prints a short usage string. The usage string is also displayed when the number or format of input parameters is
incorrect.
--interactive
Starts interactive mode, where svmotion prompts you for all arguments. In interactive mode, svmotion does a
sanity test on each option.
Note: You must enclose strings that contain special characters in quotes when responding to prompts.
--datacenter <datacenter_name>
Datacenter that contains the virtual machine to be migrated. Surround the name in quotes if it contains white
spaces or special characters.
--disks <virtual_disk_datastore_path>:<new_datastore>...
Locations of individual disks. The format is datastore path of the disk, colon, name of the destination datastore.
If the path contains spaces or special characters, you must quote it. You can specify multiple datastore and
destination pairs, separated by commas. If you do not specify this option, all virtual disks associated with a
virtual machine are relocated to the same datastore as the virtual machine configuration file. Specify this option
to locate individual virtual disks to different datastores.
To keep a virtual disk on its current datastore, use the --disks option for that disk, with its current datastore as
the <new_datastore>.
--vm <VM_config_ds_path>:<new_ds>
EXAMPLES
These examples are formatted for readability. In general, the command should be all on one line.
Start the interactive version.
svmotion --interactive
Relocate a virtual machine's storage to new_datastore, but leave the two disks (myvm/myvm_1.vmdk and
myvm/myvm_2.vmdk) in old_datastore:
svmotion --datacenter='My DC'
--vm='[old_datastore] myvm/myvm.vmx:
new_datastore'
--disks='[old_datastore] myvm/myvm_1.vmdk:
old_datastore,
[old_datastore] myvm/myvm_2.vmdk:
old_datastore'
vicfg-advcfg - query and modify advanced VMkernel options. Use when instructed by Technical Support.
vicfg-advcfg - enable and disable CIM providers.
SYNOPSIS
vicfg-advcfg <connection_options>
[--default <value> |
--get <path> |
--get-kernel <boot_parameter> |
--quiet |
--help |
--set <value> <option> |
--set 0|1 UserVars.CIMEnabled |
--set 0|1 UserVars.CIMOEMProvidersEnabled |
--set 0|1 UserVars.CIMCustomProvidersEnabled |
--set-kernel <value> <boot_parameter> |
--set-message <message> |
--vihost <esx_target>]
DESCRIPTION
connection_options
Specifies the target server and authentication information if required. Run vicfg-advcfg --help for a list of all
connection options.
--default | -d <option>
Sets the value of a specific configuration item to the default value defined by the VMkernel. Use this option
when VMware Technical Support or a VMware Knowledge Base article instruct you to do so.
--get | -g <config_option>
Gets the value of a configuration option based on its path, and print the value to stdout. Use this option when
VMware Technical Support or a VMware Knowledge Base article instruct you to do so.
--get-kernel | -j <boot_param>
Gets the value of a VMkernel boot parameter. Use this option when VMware Technical Support or a VMware
Knowledge Base article instruct you to do so.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--quiet | -q
No output to stdout while executing the command.
--set | -s <value> <option>
Sets the value of a configuration option based on its path. Use this option when VMware Technical Support or a
VMware Knowledge Base article instruct you to do so.
--set | -s 0|1 UserVars.CIMEnabled
Sets the value of a VMkernel boot parameter. Use this option when VMware Technical Support or a VMware
Knowledge Base article instruct you to do so.
--set-message | -m <message>
Sets DCUI welcome message (valid for vSphere 4.0 and later). Use this option when VMware Technical Support
or a VMware Knowledge Base article instruct you to do so.
--list | -l
>
When you execute a vSphere CLI with the --server option pointing to a vCenter Server System, you can use --
vihost to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options. Run vicfg-advcfg --help for a list of common
options including connection options.
Set the value of a specific configuration item given its identifying path and the value to set:
vicfg-advcfg <conn_options> -s 1 VMkernel.Boot.xapicForce
Get the value of a specific configuration item given its identifying path, and print the value to stdout:
vicfg-advcfg <conn_options> -g VMkernel.Boot.xapicForce
Set the value of a specific configuration item to the default value defined by the VMkernel:
vicfg-advcfg <conn_options> -d Irq.RoutingPolicy
SYNOPSIS
vicfg-authconfig
<conn_options>
[--adpassword |
--adusername |
--authscheme |
--currentdomain |
--force |
--getremoteauthstore |
--help |
--leavecurrentdomain |
--listauthstores
--vihost]
DESCRIPTION
List information about Active Directory domains for a host, join an Active Directory domain, or leave the current
domain.
OPTIONS
--adpassword | -w <password>
Password with which to log into the domain controller. Use this option with the --joindomain option. If you do
not specify an AD password at the command line, the system prompts you.
--adusername | -U <name>
User name with which to log in to the domain controller. Use this option with the --joindomain option. If you do
not specify an AD user at the command line, the system prompts you.
--authscheme | -t AD
The authentication scheme to be configured. Currently the only supported argument is AD.
conn_options
Specifies the target server and authentication information if required. Run vicfg-authconfig --help for a list of all
connection options.
--currentdomain | -c
Displays the currently joined domain. Use this option in conjunction with the --authscheme option. This option
takes no arguments.
--force | -f
Use this option with the --leavecurrentdomain option to delete any AD user permissions on entities. If you run
vicfig-authcfg --leavecurrentdomain, AD user permissions are present, and you do not use --force, the operation
fails.
--getremoteauthstore | -a
Joins the specified Active Directory domain. Use this option with the --authscheme option. This option takes in
the FQDN of the directory server as the argument.
--leavecurrentdomain | -L
Leaves the currently joined domain. Use this option with the --authscheme option. If AD user permissions on
entities exist, the operation fails unless you specify --force. This option takes no arguments.
--listauthstores | -l
When you execute a vSphere CLI with the --server option pointing to a vCenter Server system, use --vihost to
specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-authconfig --help for a list of common options including connection
options.
List the supported authentication schemes:
vicfg-authconfig <conn_options> --listauthstores
SYNOPSIS
vicfg-cfgbackup
<conn_options>
[--force |
--help |
--load <backupfile> |
--reset |
--save <backupfile>]
DESCRIPTION
The vicfg-cfgbackup command backs up ESXi configuration data and restores them later. You can back up the host
configuration, restore the configuration to the host, force the restore of the configuration, and reset the host to factory
settings.
Back up ESXi host configuration before you change the configuration or upgrade the ESXi image. The vSphere Upgrade
Guide discusses backing up and restoring the ESXi configuration in some detail.
Important: This command is supported for ESXi hosts but not for ESX hosts.
OPTIONS
conn_options
Specifies the target server and authentication information if required. Run vicfg-cfgbackup --help for a
list of all connection options.
--force | -f
Forces the restore of the configuration.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--load | -l <backupfile>
Restores configuration from <backupfile> onto the host.
--save | -s <backupfile>
Backs up the host configuration.
Include the number of the build that is running on the host that you are backing up in the backup filename. If
you are running the vSphere CLI from vMA, the backup file is saved locally on vMA. Local storage for backup files
is safe because vMA is stored in the /vmfs/volumes/<datastore> directory, which is separate from the ESXi
image and configuration files.
--reset | -r
Resets the host to factory settings.
--quiet | -q
Performs all operations without prompting for confirmation.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-cfgbackup --help for a list of common options including
connection options.
Back up the host configuration to the file C:\backup.txt:
vicfg-cfgbackup <conn_options> -s C:\backup.txt
SYNOPSIS
vicfg-dns <conn_options>
[--dhcp [yes|no] |
--dns <server_list> |
--domain <domain_name> |
--help |
--hostname <dns_host> |
--vnic <virtual_nic> |
--refresh |
--vihost <esx_host> ]
To list the existing DNS configuration, call the command without options.
DESCRIPTION
The vicfg-dns command lists and specifies the DNS configuration of your ESX/ESXi host. Call the command without
command-specific options to list the existing DNS configuration.
If you attempt to change the host name, domain name, or DNS server on hosts that use DHCP (dynamic host
configuration protocol), an error results.
OPTIONS
conn_options
Specifies the target server and authentication information if required. Run vicfg-dns --help for a list of all
connection options.
--dhcp | -H [yes|no]
Specifies whether or not the ESX/ESXi host should use DHCP to determine the DNS configuration automatically.
If you use this option, you must specify yes or no.
--dns | -D <server_list>
DNS server or servers to be used. Specify a comma-separated list of DNS servers, in order of preference. For
vSphere 4.0 and later, IPv6 addresses are valid.
--domain | -d <domain_name>
The domain name portion of the DNS name. For example, comp-xyz.com.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--hostname | -n <dns_host>
Human-readable host name portion of the DNS name. For example, esx01.
--vnic | -V <virtual_nic>
The virtual network adapter to use in overriding the system DNS. This option is required when --dhcp is yes. For
ESX systems, <virtual_nic> must be one of the Service Console network adapters. For ESXi, <virtual_nic> must be
one of the VMkernel network adapters. The specified virtual network adapter must have DHCP configured.
--refresh | -r
Refresh the network system.
--vihost | -h <esx_host>
When you execute a vSphere CLI with the --server option pointing to a vCenter Server system, use --vihost
to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options. Run vicfg-dns --help for a list of common
options including connection options.
Display DNS properties for the specified server. The information includes the host name, domain name, DHCP setting
(true or false) and DNS servers on the ESX/ESXi host:
vicfg-dns <conn_options>
Specify that the host should use DHCP to determine the DNS configuration:
vicfg-dns <conn_options> --dhcp yes --vnic <virtual_nic>
Disable DHCP:
vicfg-dns <conn_options> --dhcp no
vicfg-dumppart - query, set, and scan for diagnostic partitions on an ESX/ESXi system
NAME
vicfg-dumppart - query, set, and scan for diagnostic partitions on an ESX/ESXi system
SYNOPSIS
vicfg-dumppart [<conn_options>]
[--activate <partition> |
--deactivate <partition> |
--find |
--get-active |
--get-config |
--help |
--list |
--set <partition> |
--smart-activate |
--vihost]
DESCRIPTION
The vicfg-dumppart command queries, sets, and scans an ESX/ESXi host's diagnostic partitions. The ESX Configuration
Guide and the ESXi Configuration Guide discuss diagnostic partitions in detail and explain how to create a diagnostic
partition using the vSphere Client UI.
OPTIONS
connection_options
Specifies the target server and authentication information if required. Run vicfg-dumppart --help for a list of
all connection options.
--activate | -a <partition>
Makes the specified partition the current diagnostic partition. This option has the same effect as --set.
--deactivate | -d <partition>
Deactivates the active diagnostic partition. Specifying the name of the partition is optional. WARNING: If you
run vicfg-dumppart with this option, your system cannot write errors to a file until another partition is activated.
You lose any error record if errors occur.
--find | -f
Finds all diagnostic partitions on the ESX/ESXi host and prints them. The partitions can include, in order of
suitability, parallel adapter, block adapter, Fibre Channel, and hardware iSCSI.
--get-active | -t
Displays the active diagnostic partition for this system. Running vicfg-dumppart with this option returns the
internal name of the partition (naa.xxxxx:1) or 'none' if no partition is set.
--get-config | -c
Lists all configured partitions on the system.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--list | -l
Lists all partitions on the ESX/ESXi system that have the appropriate partition type to act as a diagnostic
partition. CAUTION: Execution might take several minutes and slow down your ESX/ESXi host because the
command scans all LUNs on the system.
--set | -s <partition>
Sets and activates the diagnostic partition, which you must specify using naa.xxx:1 or eui.xxx syntax. Specify
none to deactivate the active diagnostic partition.
--smart-activate | -S
This option is currently not supported.
--vihost | -h
When you run a vCLI command with --server pointing to a vCenter Server system, use --vihost to specify
the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-dumppart --help for a list of common options including
connection options.
List the partitions available for diagnostic partitions: WARNING: This call scans all LUNs on the system and might
degrade system performance:
vicfg-dumppart <conn_options> -l
Get the active diagnostic partition for this system. Return the internal name of the partition:
vicfg-dumppart <conn_options> -t
Set the diagnostic partition for this system and activate it:
vicfg-dumppart <conn_options> -s naa.xxxxx:1
Deactivate the active diagnostic partition: WARNING: Deactivating the diagnostic partition leaves your system without
any means of reporting errors until another partition is activated.
vicfg-dumppart <conn_options> -d
SYNOPSIS
vicfg-hostops [<conn_options>]
[--action [suspend|poweroff] |
--cluster |
--datacenter |
--force |
--operation [enter | exit | shutdown | reboot | info] ]
DESCRIPTION
OPTIONS
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-hostops --help for a list of common options including connection
options.
Put the host into maintenance mode:
vicfg-hostops <connection_options> -o enter
Put the host in maintenance mode and power off all powered on virtual machines:
vicfg-hostops <connection_options> -o enter -a poweroff
Put all hosts in the specified datacenter in maintenance mode, and suspend virtual machines that are powered on on
those hosts:
vicfg-hostops --server <VC server name> --username <user name>
--password <password> -o enter -d <datacenter name>
-h <esx_host_name> -a suspend
Shut down all hosts in a cluster. If the hosts are not in maintenance mode, power off all virtual machines and put the
hosts into maintenance mode:
vicfg-hostops --server <VC server name> --username <user name>
--password <password> -o shutdown
-c <cluster_name> -h <esx_host_name> --force
Reboot the host(s) in the datacenter that belong to the specified cluster. If hosts are not in maintenance mode, wait
until they are:
vicfg-hostops --server <VC_server-name> --username <user name>
--password <password> --operation reboot -d <datacenter_name>
-c <cluster_name> --vihost <esx_host_name> -f
SYNOPSIS
vicfg-ipsec [<conn_options>]
[--action [none|discard|ipsec] |
--add-sa <sa> |
--add-sp <sp> |
--dir [in | out] |
--dst-port <port> |
--flush-sa |
--flush-sp |
--ealgo [null | 3des-cbc | aes128-cbc]|
--ekey <e_key>|
--help |
--ialgo [hmac-sha1 | hmac-sha2-256] |
--ikey <i_key> |
--list-sa <sa> |
--list-sp <sp> |
--remove-sa <sa> |
--remove-sp <sp> |
--sa-dst <destination>
--sa-src <IP> |
--sa-name <name> |
--sp-dst <destination> |
--spi <spi> |
--sp-src <source> |
--spmode <mode> |
--src-port <port> |
--ulproto [any | tcp | udp | icmp6]
DESCRIPTION
vicfg-ipsec allows you to configure IPsec on your ESX/ESXi host. The command supports IPv6 but not IPv4 configuration.
OPTIONS
conn_options
Specifies the target server and authentication information if required. Run vicfg-ipsec --help for a list of
all connection options.
--action [none|discard|ipsec]
Action to take. Specify none to to allow all traffic, discard to discard all traffic, or ipsec to use IPsec with the
specified authentication and encryption settings.
--add-sa <sa>
Adds a security association. Use this option together with the --sa-src, --sa-dst, --sa-mode, and other
parameters to create a security association. The last parameter is always the name of the association.
--add-sp <sp>
Adds a security policy. Use this option together with the <--sp-src>, --sp-dst, --src-port, --dst-port and
other parameters to create a security policy. You must associate this policy with a named security association.
The last argument is always the name of the security policy.
--dir [in | out]
Direction, in our out.
--dst-port <port>
Destination port (0-65535)
--ealgo [null | 3des-cbc | aes128-cbc]
Encryption algorithm.
--ekey <e_key>
Encryption key; a series of hexadecimal digits preceded with 0x (zero ex).
--ialgo [hmac-sha1 | hmac-sha2-256]
Authentication algorithm.
--ikey <i_key>
Authentication key; a series of hexadecimal digits preceded with 0x (zero ex).
--flush-sa
Clear all entries in the Security Associations (sa) database. WARNING This option clears all entries even if SAs
are in use.
--flush-sp
Clear all entries in the Security Policy (sp) database. WARNING This option clears all entries even if SPs are in
use.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--list-sa | -l
Display security sssociations.
--list-sp | -L
Display security policies.
--remove-sa <sa>
Removes a specified security association.
--remove-sp <sp>
Removes a specified security policy.
--sa-dst <destination_IP>
Destination IP of the Security Association.
--sa-src <source_IP>
Source IP of the Security Association.
--sa-name <name>
Security Association name. Specify auto to let the VMkernel choose an SA. If no suitable SA exists, the
VMkernel requests one using IKE.
--sp-dst <destination>
Destination IP address and prefix length.
--spi <spi>
Security parameters index. This index identifies security parameters in combination with IP address. The index
must be a hexadecimal number with a 0x prefix.
--sp-src <source>
Source IP address and prefix length.
--spmode [tunnel | transport]
Mode, either tunnel or transport.
--src-port <source_port>
Source port (0-65535)
--ulproto [any | tcp | udp | icmp6]
Upper layer protocol.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-ipsec --help for a list of common options including connection
options.
Display all current IPsec properties:
vicfg-ipsec <conn_options> -l | --list-sa
vicfg-ipsec <conn_options> -L | --list-sp
Create a security association:
vicfg-ipsec <conn_options> --add-sa --sa-src 3ffe:501:ffff:0::a --sa-dst
3ffe:501:ffff:0001:0000:0000:0000:0001
--sa-mode transport --spi 0x1000
--ealgo 3des-cbc --ekey 0x6970763672656164796c6f676f336465736362636f757432
--ialgo hmac-sha1 --ikey 0x6970763672656164796c6f67736861316f757432 sa1
SYNOPSIS
vicfg-iscsi [<connection_options>] [option] [suboption] [parameter] [<adapter_name>]
DESCRIPTION
vicfg-iscsi supports configuration and property retrieval for software or hardware iSCSI initiators. See the vSphere
Command-Line Interface Installation and Scripting Guide for more information.
OPTIONS
connection_options
Specifies the target server and authentication information if required. Run vicfg-iscsi --help for a list of
all connection options.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--chap_password
Authentication password to use for setup of CHAP. Use with the --authentication option.
--chap_username
Authentication user name to use for setup of CHAP. Use with the --authentication option.
--discovery --list
Returns a list of discovery addresses and static targets and related properties if configured.
--discovery --add --ip <ip_addr | domain_name> [:<port_num>]
Adds a discovery address, by using <ip_addr> or <domain_name> and optional <port_num>, if <port_num> is
not specified, uses 3260 as default.
--discovery --remove --ip <ip_addr | domain_name> [:<port_num>]
Removes a discovery address, by using <ip_addr> or <domain_name> and optional <port_num>, if <port_num>
is not specified, uses 3260 as default.
--static --list
Returns a list of static discovery target(s) and related properties.
--static --add --ip <ip_addr | domain_name> [:<port_num>] --name <iscsi_name>
Adds a static discovery target by using <ip_addr> or <domain_name> and optionally <port_num>. If
<port_num> is not specified, uses 3260 as the default. The the target iscsi name must be in IQN or EUI format.
--static --remove --ip <ip_addr | domain_name> [:<port_num>] --name <iscsi_name>
Removes a static discovery target by using <ip_addr> or <domain_name> and optionally <port_num>. If
<port_num> is not specified, uses 3260 as the default. The target iscsi name must be in IQN or EUI format.
--authentication --list
Lists authentication method settings.
If only CHAP is set:
--authentication --level <level> --method <auth_method>
--mchap_username <m_username> --mchap_password <m_password>
[--ip <ip_addr | domain_name>[:<port_num>]
[--name<iscsi_name>]]>
If both CHAP and MCHAP are set:
--authentication --level <level> --method <auth_method>
--chap_username <username> --chap_password <password>
--mchap_username <m_username> --mchap_password <m_password>
[--ip <ip_addr | domain_name>[:<port_num>]
[--name<iscsi_name>]]>
--authentication --level <level> --method <auth_method> --chap_username<username> --chap_password
<password>> [--ip <ip_addr | domain_name>[:<port_num>] [--name <iscsi_name>]]
Sets iSCSI authentication properties. Sets level, authentication username and password. Supported
<auth_method> is CHAP.
Level is one of [chapRequired | chapPreferred | chapDiscouraged | chapProhibited].
If --ip and --name are specified, authentication is set for per-target CHAP. If only --ip is specified,
authentication is set for per discovery address CHAP. If neither --ip nor --name is specified, authentication is
set for per adapter CHAP.
--authentication --reset_auth --method <auth_method> --ip <ip_addr | domain_name>[:<port_num>] [--name
<iscsi_name>]
Resets target-level CHAP authentication properties to be inherited from the adapter level. Resetting adapter-
level properties is not supported.
--authentication --level <level> --method <auth_method> --mutual --mchap_username<username> --
mchap_password <password> [--ip <ip_addr | domain_name>[:<port_num>] [--name <iscsi_name>]]
Sets iSCSI authentication properties (level, authentication username and password) Specify CHAP as the value of
<auth_method>. Specify --mutual to indicate mutual CHAP.
Level is [chapRequired | chapPreferred | chapDiscouraged | chapProhibited] for simple CHAP and
[chapRequired | chapProhibited] for mutual CHAP.
If --ip and --name are specified, authentication is set for per-target mutual CHAP. If only --ip is specified,
authentication is set for per discovery address mutual CHAP. If neither --ip nor --name is specified,
authentication is set for per-adapter mutual CHAP.
--authentication --reset_auth --method <auth_method> --mutual --ip <ip_addr | domain_name>[:<port_num>] [--
name <iscsi_name>]
Resets target-level mutual CHAP authentication properties to be inherited from adapter level. Resetting
adapter-level properties is not supported.
--phba --list
Lists PHBA properties.
--target --list
Lists all target properties.
--lun --list
Lists LUN properties, including device name, bus number, LUN id, and size.
--lun --list --target_id <target_id>
Lists LUN properties for the specified <target_id>. Run vicfg-iscsi --lun --list to view the target ID.
--mchap_password
Authentication password to use for setup of mutual CHAP. Use with the --authentication option.
--mchap_username
Authentication user name to use for setup of mutual CHAP. Use with the --authentication option.
--network --list
Lists network properties, including IP, subnet mask, default gateway, etc.
--network --ip <ip_addr>
Sets the HBA IPv4 address to <ip_addr>.
--network --subnetmask <subnet_mask>
Sets the HBA network mask to <subnet_mask>.
--network --gateway <default_gateway>
Sets the HBA gateway to <default_gateway>.
--network --set ARP=true|false
Enables or disables ARP redirect.
--pnp --list
Lists physical network portal properties, including mac address info, max and current transfer rate, and MTU
size.
--pnp --mtu <mtu_size>
Sets MTU size to <mtu_size>.
--iscsiname --list
Lists iSCSI initiator node properties, including iSCSI name and alias name.
--iscsiname --name <iscsi_name>
Sets the iSCSI initiator node name to <iscsi_name> in IQN or EUI format.
--iscsiname --alias <alias_name>
Sets the iSCSI initiator node alias to <alias_name>.
--parameter --list [--detail] [--ip <ip_addr | domain_name> [:<port_num>][--name <iscsi_name>]]
Lists iSCSI parameters and their current value. If --ip and --name are specified, the list is for per target
parameters. If only --ip is specified, the list is for per discovery address parameters. If neither --ip nor --
name are specified, the list is for adapter parameters. Specifying --detail lists detailed properties of iSCSI
parameters.
--parameter --set <name>=<value> [--ip <ip_addr | domain_name>[:<port_num>] [--name <iscsi_name>]]
Sets the specified iSCSI parameter to the specified value if the parameter is settable. If --ip and --name are
specified, sets per target parameters. If only --ip is specified, sets per discovery address parameters. If neither
--ip nor --name is specified, sets adapter parameters. Run --parameter --list --detail for
information on whether a parameter is settable or not. The following parameters are supported. See the
vSphere Command-Line Interface Installation and Scription Guide for more information.
dataDigestType
HeaderDigest
MaxOutstandingR2T
FirstBurstLength
MaxBurstLength
MaxRecvDataSegLen
NoopInterval
NoopTimeout
RecoveryTimeout
DelayedAck
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-iscsi --help for a list of common options including connection
options.
List discovery addresses and static targets (if configured) and related properties:
vicfg-iscsi <conn_options>
--discovery --list <adapter_name>
Reset target level CHAP authentication properties to be inherited from adapter level:
vicfg-iscsi <conn_options>
--authentication --method <auth_method> --reset_auth --ip <ip_addr |
domain_name> [--name <iscsi_name>] <adapter_name>
Reset target level iSCSI parameter to be inherited from the adapter level:
vicfg-iscsi <conn_options>
--parameter --reset <name> --ip <ip_addr | domain_name> <adapter_name>
SYNOPSIS
vicfg-module [<connection_options>]
[--get-options <module_name> |
--help |
--list |
--set-options "<option> <value>" <module_name> |
--vihost <esx_host> ]
DESCRIPTION
The vicfg-module command supports setting and retrieving VMkernel module options. This command is a vSphere CLI
implementation of the esxcfg-module service console command, but it supports only some of the options esxcfg-
module supports. The command is commonly used when VMware Technical Support, a Knowledge Base article, or
VMware documentation instruct you to do so.
OPTIONS
connection_options
Specifies the target server and authentication information if required. Run vicfg-module --help for a list of
all connection options.
--get-options | -g <module_name>
Returns the option string configured to be passed to the module when it is loaded. This string is not necessarily
the option string currently in use by the module.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--list | -l
Lists the set of modules on the host (valid for vSphere 4.0 and later).
--set-options | -s "<option>=<value>" <module_name>
Specifies the option string to be passed to the module when the module is loaded.
--vihost | -h
When you run a vSphere CLI command with the --server option pointing to a vCenter Server system, use --
vihost to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Use vicfg-module --help for a list of common options including connection
options.
Configure a supported NIC to use NetQueue:
vicfg-module <conn_options> -s "intr_type=2 rx_ring_num=8" s2io
SYNOPSIS
vicfg-mpath35 [OPTIONS]
DESCRIPTION
vicfg-mpath35 provides an interface to configure multipath settings for Fibre Channel or iSCSI LUNs on ESX/ESXi version
3.5 hosts. Use vicfg-mpath for ESX/ESXi 4.0 and later hosts.
OPTIONS
--help
Prints a help message for each command-specific and each connection option. Calling the command with no
arguments or with --help has the same effect.
--list | -l
Lists all LUNs and the paths to these LUNs through adapters on the system. For each LUN, the command
displays the type, internal name, console name, size, and paths, and the policy used for path selection.
--policy | -p
Sets the policy for a given LUN to one of "mru", "rr", or "fixed". Most Recently Used (mru) selects the path most
recently used to send I/O to a device. Round Robin (rr) rotates through all available paths. Fixed (fixed) uses only
the active path. This option requires that you also specify the --lun option.
--state | -s
Sets the state of a given LUN path to either "on" or "off". This option requires that you also specify the --lun
and --path options.
--preferred | -f
Sets the given path to be the "preferred" path for a given LUN. This option requires that you also specify the --
lun and --path options.
--query | -q
Queries a specific LUN for its information and print it. This option requires that you also specify the --lun
option.
--path | -P
Specifies the path to use in other operations. You cannot use this option by itself.
--lun | -L
Specifies the LUN to use in other operations. You cannot use this option by itself.
--detailed | -d
Displays all information about a LUN and its paths including the vml name of the LUN.
--bulk | -b
Shows all LUNs and paths in a format easily parsed by scripts.
--hbas | -a
Prints the list of HBAs that can be identified by a unique ID. This option lists Fibre Channel and iSCSI devices.
Parallel and Block devices do not appear in the list.
--vihost | -h
When you execute this command with --server pointing to a vCenter Server system, you can use --vihost
to specify the ESX/ESXi host to run the command against.
EXAMPLES
List all LUNs and the paths to these LUNs through adapters on the system:
vicfg-mpath35 --server <servername> --username <user name>
--password <password> -l
Set the policy for a specific LUN. Requires --lun is also specified to indicate the LUN to operate on:
vicfg-mpath35 --server <server name> --username <user name>
--password <password> --policy mru --lun vmhba0:8:0
Set the state for a specific LUN path. Requires both --lun and --path are specified. This operation may appear to fail if
there is active I/O on a path that is set to "off":
vicfg-mpath35 --server <server name> --username <user name>
--password <password> --state <on|off> --path <path flag> --lun <lunname>
Set the given path to be the preferred path for the given LUN. Requires both --path and --lun are specified:
vicfg-mpath35 --server <server name> --username <user name>
--password <password> --preferred --path vmhba0:8:0 --lun vmhba0:8:0
Indicate which LUN to operate on. You can specify the LUN either with its internal VMkernel vmhba name (vmhbaX:X:X)
or with its vml name as found in /vmfs/devices/disks:
vicfg-mpath35 --server <server name> --username <user name>
--password <pasword> --policy mru --lun vmhba0:8:0
DESCRIPTION
The vicfg-mpath command supports listing information about Fibre Channel or iSCSI LUNs and changing a path's state.
Use vicfg-mpath35 when running against ESX/ESXi 3.5 systems. Use the esxcli command for managing pluggable storage
architecture (PSA) and native multipathing (NMP), including path policy modification.
OPTIONS
connection_options
Specifies the target server and authentication information if required. Run vicfg-mpath --help for a list of
all connection options.
--device | -d
Used to filter the list commands to display only information about the specified device.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--list | -l <path_or_device>
Lists detailed information for all paths on the system or for the specified path or device.
--list-compact | -L <path_or_device>
Lists all paths with abbreviated information.
--list-map | -m <path_or_device>
Lists all paths and the corresponding adapter and device mappings.
--list-paths | -b <device>
Lists all devices with their corresponding paths, or lists paths for the specified device.
--list-plugins | -G
Lists all multipathing plugins loaded into the system. At a minimum, this command returns NMP (Native
Multipathing Plugin). If other MPP plugins have been loaded, they are listed as well. For information about
storage array plugins, see the ESX Configuration Guide and the ESXi Configuration Guide. You manage plugins
with the esxcli command; run esxcli --help to get started and see the vSphere Command-Line Interface
Installation and Scripting Guide for more information.
--path | -P
Used to specify a specific path for operations. The path name may be either the long path UID or the shorter
runtime name of the path. Use this option to filter any of the list commands to a specific path.
--state|-s active|off
Sets the state of a given LUN path to either active or off. This option requires that the --path options is set and
specifies either the path UID or the path runtime name.
If you are changing a path's state, the change operation fails if I/O is active when the path setting is changed.
Reissue the command. You must issue at least one I/O operation before the change takes effect.
--vihost | -h
When you run a vCLI command with the --server option pointing to a vCenter Server system, use --vihost
to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options. Run vicfg-mpath --help for a list of
common options including connection options.
List all paths on the system with their detailed information:
vicfg-mpath <conn_options> -l
List a path by specifying its runtime name with its detailed information:
vicfg-mpath <conn_options> -l -P vmhba32:C0:T1:L0
Set the state for a specific path to off. Requires the --path option.
vicfg-mpath <conn_options> --state off --path <path name>
If you are changing a path's state, the change operation fails if I/O is active when the path setting is changed. Reissue
the command. You must issue at least one I/O operation before the change takes effect.
SYNOPSIS
vicfg-nas [<conn_options>]
[--add --nasserver <server_name> --share <share_name> |
--delete <share_name> |
--help |
--list |
--nasserver <server_name> |
--readonly |
--vihost <esx_host ]
DESCRIPTION
The vicfg-nas command manipulates NAS file systems associated with ESX/ESXi hosts. For more information on working
with NAS file systems, see the ESX Configuration Guide and the ESXi Configuration Guide.
OPTIONS
--add | -a
Adds a new NAS file system to /vmfs/volumes on the ESX/ESXi host. The command adds an entry to the known
NAS file system list, but does not mount the file system. When you use this option, you must also use the --
nasserver|-o and --share|-s options, and must specify a label name for the new file system.
connection_options
Specifies the target server and authentication information if required. Run vicfg-nas --help for a list of all
connection options.
--delete | -d <share_name>
Deletes a NAS file system. This command unmounts the NAS file system and removes it from the list of known
file systems.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--list | -l
Optional. Lists all known NAS file systems with their mount name, share name, and host name and indicates for
each file system whether it is mounted.
--nasserver | -o <server_name>
Used in conjunction with the --add|-a option to supply the host name for a new NAS file system.
--share | -s <share_name>
Used in conjunction with the --add|-a option to supply the share name of a new NAS file system.
--readonly | -y
Adds the new NAS filesystem with readonly access.
--vihost | -h
When you run a vCLI command with the --server option pointing to a vCenter Server system, use --vihost
to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-nas --help for a list of common options including connection
options.
List all known NAS file systems with their mount name, share name, and hostname and indicate whether each is
mounted:
vicfg-nas <conn_options> -l
Add a new NAS file system to the ESX Server. This will add an entry to the known NAS file system list. You must supply
the host name and the share name for the new NAS file system:
vicfg-nas <conn_options> -a -o <nasserver> -s /home FileServerHome
Add a new readonly NAS file system to the ESX Server. This will add an entry to the known NAS file system list. You must
supply the host name and the share name for the new NAS file system:
vicfg-nas <conn_options> -a -y -o <nasserver> -s /home FileServerHome
Delete a NAS file system. The command unmounts the NAS file system and removes it from the list of known file
systems:
vicfg-nas <conn_options> -d FileServerHome
vicfg-nics - get information, set speed and duplex for ESX/ESXi physical NICs
SYNOPSIS
vicfg-nics [<connection_options>]
--auto <nic> |
--duplex [full|half] <nic>
--help |
--list |
--speed [10 | 100 | 1000 | 10000] <nic> |
--vihost <esx_host>]
DESCRIPTION
The vicfg-nics command manages uplink adapters, that is, the Ethernet switches used by an ESX/ESXi host. You can use
vicfg-nics to list the VMkernel name for the uplink adapter, its PCI ID, driver, link state, speed, duplex setting, MAC
address and a short PCI description of the card. You can also specify speed and duplex settings for an uplink adapter.
OPTIONS
--auto | -a <nic>
Sets the NIC to auto-negotiate its speed and duplex settings Requires a NIC parameter.
connection_options
Specifies the target server and authentication information if required. Run vicfg-nics --help for a list of all
connection options.
--duplex | -d [full|half] <nic>
Sets the duplex value at which a given network adapter should run to either full (transmit data in both
directions at the same time) or half (transmit data in one direction at a time). Requires a NIC parameter.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--list | -l
Lists the NICs in the system and, for each NIC, the PCI bus, driver, speed, duplex information, MAC address, and
a description. Also shows whether the link is up.
--speed | -s <speed> <nic>
Sets the speed at which a given network adapter should run. Valid values for <speed> are 10, 100, 1000, or
10000. Requires a NIC parameter.
--vihost | -h
When you run a vCLI command with the --server option pointing to a vCenter Server system, use --vihost
to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-nics --help for a list of common options including connection
options.
List the NICs in the system and print their current and configured speed and duplex settings:
vicfg-nics <conn_options> -l
Set the duplex setting for vmnic0 to full and the speed to 100:
vicfg-nics <conn_options> -d full -s 100 vmnic0
SYNOPSIS
vicfg-ntp [connection_options]
[--add <name_or_IP> |
--delete <name_or_IP |
--help |
--list |
--start |
--stop |
--vihost <esx_host>]
DESCRIPTION
The vicfg-ntp command supports specifying the NTP (Network Time Protocol) server for an ESX/ESXi host. Some
protocols, such as Kerberos, must have accurate information about the current time.
OPTIONS
--add | -a
Adds the specified NTP server. You can use the name or IP address to specify the NTP server (IPv6 address valid
for vSphere 4.0 and later).
connection_options
Specifies the target server and authentication information if required. Run vicfg-ntp --help for a list of all
connection options.
--delete | -d
Deletes the specified NTP server. You can use the name or IP address to specify the NTP server (IPv6 address
valid for vSphere 4.0 and later).
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--list | -l
Displays all NTP servers used by the host.
--start | -r
Starts the NTP service on the target host.
--stop | -s
Stops the NTP service on the target host.
--vihost | -h
When you run a vCLI command with the --server option pointing to a vCenter Server system, use --vihost
to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-ntp --help for a list of common options including connection
options.
Display the list of NTP servers used by this host:
vicfg-ntp --server <server name> --username <user name>
--password <password> --list
Add a remote NTP server with the specified host name or IP address:
vicfg-ntp --server <server name> --username <user name>
--password <password> --add <ntp-server>
Delete the remote NTP server with the specified host name or IP address:
vicfg-ntp --server <server name> --username <user name>
--password <password> --delete <ntp-server>
SYNOPSIS
vicfg-rescan [<connection_options>]
<adapter name>
[--help
--vihost <esx_host>]
DESCRIPTION
Perform a rescan operation each time you reconfigure your storage setup. You can use the vicfg-rescan vSphere CLI or
the vSphere Client to perform a rescan.
See the ESX Configuration Guide and the ESXi Configuration Guide. The Fibre Channel SAN Configuration Guide discusses
rescan on Fibre Channel storage. The iSCSI SAN Configuration Guide discusses rescan on iSCSI storage.
When you rescan an ESX/ESXi host, the command returns only an indication of success or failure and no detailed
information.
OPTIONS
<adapter_name>
Name of the adapter, for example vmhba1.
connection_options
Specifies the target server and authentication information if required. Run vicfg-rescan --help for a list of
all connection options.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--vihost | -h <esx_host>
When you run a vCLI command with --server pointing to a vCenter Server system, use --vihost to specify
the ESX/ESXi host to run the command against.
EXAMPLES
The following example assumes you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-rescan --help for a list of common options including connection
options.
Refresh adapter registration. This command needs a adapter name to work, for example, vmhba0 or vmhba1:
vicfg-rescan <conn_options> vmhba0
SYNOPSIS
vicfg-route [<connection_options>]
[--add <route> |
--del <route> |
--help |
--list |
--family [v4 | v6] |
--vihost <esx_host>]
[<gateway>]
DESCRIPTION
The vicfg-route command lists or sets the default IP gateway. Changing the gateway might be required if you move your
ESX/ESXi host to a new physical location. The vicfg-route command supports a subset of the Linux route command's
options.
If you run vicfg-route with no options, the command displays the default gateway. You can use the --family option to
print the default IPv4 or the default IPv6 gateway. By default, the command displays the default IPv4 gateway.
OPTIONS
connection_options
Specifies the target server and authentication information if required. Run vicfg-route --help for a list of
all connection options.
<gateway>
The IP address or the host name of the machine that should be set as the gateway for the VMkernel IP stack.
--add | -a <route>
Adds route to the VMkernel (valid for vSphere 4.0 and later).
To add a route entry and make it the default, run
vicfg-route --add <route> default
--del | -d <route>
Deletes a route entry from the VMkernel (valid for vSphere 4.0 and later).
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--list | -l
Lists configured routes for the VMkernel.
--family | -f v4 | v6
Address family, either v4 for IPv4 or v6 for IPv6. Defaults to v4.
--vihost | -h <esx_host>
When you run a vCLI command with the --server option pointing to a vCenter Server system, use --vihost
to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-route --help for a list of common options including connection
options.
List the VMkernel IP stack's default gateway entry:
vicfg-route <connection_options>
Set the VMkernel IP stack's default gateway entry, that is, change the default gateway to a different gateway:
vicfg-route <connection_options> <new_gateway>
SYNOPSIS
vicfg-scsidevs [<connection_options>]
[--compact-list |
--device <device> |
--hba-device-list |
--hbas |
--help |
--list |
--query |
--uids |
--vihost <esx_host> |
--vmfs]
DESCRIPTION
The vicfg-scsidevs command displays information about available LUNs on ESX/ESXi 4.x hosts. You can run vicfg-scsidevs
--query and vicfg-scsidevs --vmfs against ESX/ESXi version 3.5. The other options are supported only against ESX/ESXi
version 4.0 and later.
In previous releases of this command-line interface, the corresponding command is vicfg-vmhbadevs.
OPTIONS
connection_options
Specifies the target server and authentication information if required. Run vicfg-scsidevs --help for a list
of all connection options.
--compact-list | -c
Lists all logical devices, each on a single line, with limited information. The information includes the device ID,
device type, size, and plugin and device display name. You can specify the --device option to list information
about a specific device.
--device | -d
Used with other options to specify the device for which you want information.
--hba-device-list | -A
For each HBA, prints a mapping between the HBA and the devices for which it provides paths.
--hbas | -a
Prints HBA devices with identifying information. This includes the adapter ID, driver ID, adapter UID, PCI,
vendor, and model.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--list | -l
Lists device information for all logical devices on this system. The information includes the name (UUID), device
type, display name, and multipathing plugin. You can specify the --device option to list information about a
specific device.
--query | -q
Prints mappings in 2.5 compatibility mode to mimic a call to vmkpcidivy -q vmhba_devs.
--uids | -u
Lists the primary UID for each device and any other UIDs (aliases) for each UID. You can specify the --device
option to list information about a specific device.
--vihost | -h
When you run a vCLI command with the --server option pointing to a vCenter Server system, use --vihost to
specify the ESX/ESXi host to run the command against.
--vmfs | -m
Prints mappings for each VMFS volume to its corresponding partition, path to that partition, VMFS UUID, extent
number, and volume names.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-scsidevs --help for a list of common options including
connection options.
List all logical devices known on this system with detailed information:
vicfg-scsidevs <conn_options> -l
Print mappings for VMFS volumes to the corresponding partition, path to that partition, VMFS uuid, extent number and
volume names:
vicfg-scsidevs <conn_options> -m
Print a mapping between HBAs and the devices it provides paths to:
vicfg-scsidevs <conn_options> -A
SYNOPSIS
vicfg-snmp [<connection_options>]
[--communities <comm_list> |
--disable |
--enable |
--help |
--hwsrc |
--notraps |
--port <port_number> |
--reset |
--show |
--targets <targets> |
--test |
--vihost <esx_host>]
DESCRIPTION
Simple Network Management Protocol (SNMP) allows management programs to monitor and control networked
devices. The Basic System Administration manual discusses using SNMP in your vSphere environment in some detail.
The vSphere Command-Line Interface Scripting Guide explains setup with vSphere CLI commands.
OPTIONS
--communities | -c <comm1>[,...]
Specifies communities, separated by commas. The settings specified using this option overwrite any previous
settings.
connection_options
Specifies the target server and authentication information if required. Run vicfg-snmp --help for a list of all
connection options.
--disable | -D
Stops the SNMP service on the host.
--enable | -E
Starts the SNMP service on the host.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--hwsrc | -y
Allows you to specify where to source hardware events originating from IPMI sensors or from CIM indications.
Specify either indications or sensors.
--notraps | -n <port_number>
Comma-separated list of trap OIDs (object identifiers) for traps not to be sent by the agent. Use --notraps
reset to clear the list.
--port | -p <port_number>
Sets the port used by the SNMP agent. The default is UDP 161. This is the port that the SNMP service uses to
listen on for polling requests, such as GET requests. You can also configure the port that the SNMP agent sends
data to on the target system using the --targets option. That port is UDP 162 by default.
--reset | -r
Clears all previously-specified communities and targets.
--show | -s
Displays the current SNMP configuration.
--targets | -t <hostname[@port]> </community>[,...]
Sets the destination for (notifications) traps. You can specify multiple targets, separated by commas.
The settings specified using this flag overwrite any previous settings. For vSphere 4.0 and later, IPv6 addresses
are valid.
--test | -T
Sends a test notification that can be used to validate the SNMP configuration to the configured target or targets.
--vihost | -h
When you run a vSphere CLI command with the --server option pointing to a vCenter Server system, use --
vihost to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-snmp --help for a list of common options including connection options.
Display the SNMP agent configuration:
vicfg-snmp <conn_options> -s
Set my_comm1 and my_comm2 as the communities, overwriting any existing communities.
vicfg-snmp <conn_options> -c my_comm1,my_comm2
SYNOPSIS
vicfg-syslog [<connection_options>]
[--help |
--setport <port> |
--setserver <name_or_ip> |
--show |
--vihost <esx_host> ]
DESCRIPTION
The vicfg-syslog command specifies a remote syslog server for an ESXi host.
You cannot run this command against an ESX host. ESX administrators can edit the syslog configuration file to customize
the syslog server.
The Basic System Administration manual discusses system logs in more detail and explains how to set them up using the
vSphere Client
OPTIONS
connection_options
Specifies the target server and authentication information if required. Run vicfg-syslog --help for a list of
all connection options.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--setport | -p <port>
Sets the port number for the syslog server. Can be used with --setserver.
--setserver | -s <host_or_IP>
Set the host name or IP address of the syslog server. Can be used with --setport>.
--show | -i
Displays the syslog server configuration if a syslog server has been set up.
--vihost | -h <esx_host>
When you run a vSphere CLI command with the --server option pointing to a vCenter Server system, use --
vihost to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-syslog --help for a list of common options including connection
options.
Display the syslog server configuration:
vicfg-syslog <conn_options> -i
SYNOPSIS
vicfg-user <[conn_options>] -e <user |- group> |-o <add | modify | delete | list> [options]
Note: The syntax of this command differs from other vSphere CLI commands.
DESCRIPTION
An ESX/ESXi system grants access to its resources when a known user with appropriate permissions logs on to the
system with a password that matches the one stored for that user. The vicfg-user command supports creating,
modifying, deleting, and listing local direct access users and groups of users on an ESX/ESXi host. You cannot run this
command against a vCenter Server system.
User management is discussed in detail in the ESX Configuration Guide, the ESXi Configuration Guide, and the Basic
System Administration document.
OPTIONS
--addgroup | -g <group_list>
Comma-separated list of groups to add the user to.
--adduser | -u <user_list>
Comma-separated list of users to add to a specified group.
conn_options
Specifies the target server and authentication information if required. Run vicfg-user --help for a list of all
connection options.
--entity | -e [group | user]
Required. Entity to perform the operation on (user | group).
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--group | -d <group_name>
Group name of the group.
--groupid | -D <group_ID>
Group ID of the group.
--login | -l <login_ID>
Login ID of the user.
--newpassword | -p <password>
Password for the target user.
--newuserid | -i <UUID>
UID for the target user.
--newusername | -n <name>
User name for the target user.
--operation | -o [add | modify | delete | list]
Required. Operation to perform. Specify add, modify, delete, or list.
--promptpassword
Prompts for a password when you make a change to a user.
--removegroup | -G <group_list>
Comma-separated list of groups to remove the target user from.
--removeuser | -U <user_list>
Comma-separated list of users to be removed from the target group.
--role | -r [admin|read-only|no-access]
Role for the target user or group. Specify admin, read-only, or no-access.
--shell | -s [yes|no]
Grant shell access to the target user. Default is no shell access. Use this command to change the default, or to
revoke shell access rights after they have been granted. Valid values are yes and no.
This option is supported only for ESX. The option is meaningless for ESXi.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-user --help for a list of common options including connection
options.
Add a user with login ID user27:
vicfg-user <conn_options> -e user -o add -l user27 -p 27_password
Modify password, user ID, and user name for the user with login ID user27:
vicfg-user.pl <conn_options> -e user -o modify -l user27 -p 27_password -i <new user id> -n <new user
name>Add the user with user name user27 to a group test:
vicfg-user <conn_options> -e user -o modify -l user27 -g test
SYNOPSIS
vicfg-vmknic [conn_options]
[--add --ip<address> --netmask <netmask> <port-group-name> |
--delete <nic_name> |
--disable-vmotiion <portgroup> |
--dvs-name <dvs> |
--dvport_id <port_id> |
--enable-ipv6 [true|false] |
--enable-vmotion <portgroup> |
--help |
--ip <address> |
--list |
--mtu <mtu> |
--netmask <netmask> |
--portgroup <port_group> |
--tso |
--unset-ip |
--vihost <esx_host> ]
DESCRIPTION
OPTIONS
conn_options
Specifies the target server and authentication information if required. Run vicfg-vmknic --help for a list of
all connection options.
--add | -a
Adds a VMkernel NIC to the system. You must specify the IP address using --ip, the netmask, and the port group
name. When the command completes successfully, the newly added VMkernel NIC is enabled.
You cannot specify the dvsName and dvportId parameters with this option.
--delete | -d <port_group>
Delete the VMkernel NIC on the given port group. The port group name is the same as the VMkernel NIC name.
--disable-vmotion | -u <port_group>
Disables VMotion for the VMkernel NIC on a specified port group.
--dvs-name | -s
Specifies the distributed virtual switch (DVS) name to use as a connection point. DVS is also known as vNetwork
Distributed Switch (VDS). Requires that --dvport-id is also specified.
--dvport-id | -v
Specifies the distributed virtual port ID of the connection point. Requires that --dvs-name is also specified.
--enable-ipv6 | -6 true | false
Enables or disables IPv6 for this VMkernel NIC for the next boot. Valid for vSphere 4.0 and later.
--enable-vmotion | -E <port_group>
Enables VMotion for the VMkernel NIC on a specified port group. By default, VMotion is disabled for a port
group. To perform migration with VMotion over the network, you have to enable VMotion.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--ip | -i <ip_address> | DHCP
Sets the IP address for this VMkernel NIC. If you specify DHCP, the VMkernel must support DHCP. IP address can
be in one of the following format:
* <X.X.X.X> - Use the specified static IPv4 address
* DHCP - Enable IPv4 DHCP for address
* <X:X:X::/X> - Use the specified static IPv6 address (valid for vSphere 4.0 and later)
* DHCPV6 - Enable the IPv6 DHCP address (valid for vSphere 4.0 and later)
* AUTOCONF - Enable the IPv6 address advertised by the router (valid for vSphere 4.0 and later)
--list | -l
Lists all VMkernel NICs on the system. The list contains the network information, port group, MTU, and current
state for each virtual network adapter in the system.
--mtu | -m <mtu>
MTU (maximum transmission unit) for the interface being created (valid for vSphere 4.0 and later).
--netmask | -n <netmask>
IP netmask (X.X.X.X) to be used for the virtual network adapter. When you set a netmask, you must specify the -
-ip option in the same command.
--portgroup | -p
Specifies the port group to use as connection point.
--tso | -t
Disables TCP Segment Offloading (TSO) for the VMkernel NIC being created. By default, TSO is enabled for a
virtual NIC. When you specify this option, TSO is disabled for the virtual NIC that is being created (valid for
vSphere 4.0 and later).
--unset-ip | -U
Unsets the IP address for this VMkernel NIC (valid for vSphere 4.0 and later). The address can have one of the
following format:
* <X:X:X::/X> - Remove the specified IPv6 address
* DHCPV6 - Disable the IPv6 DHCP address
* AUTOCONF - Disable the IPv6 address advertised by the router.
--vihost | -h
When you run a vSphere CLI command with the --server option pointing to a vCenter Server system, use --vihost
to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-vmknic --help for a list of common options including connection options.
Add a VMkernel NIC to the system:
vicfg-vmknic <conn_options> -a --ip <IP address> -n <net mask> "VMkernel NIC Name"
Enable IPv6 for the VMkernel NIC for the next boot:
vicfg-vmknic VMkernel --enable-ipv6 true
SYNOPSIS
vicfg-volume [<connection_options>]
[--help |
--list |
--persistent-mount <VMFS-UUID|label> |
--resignature <VMFS-UUID|label> |
--umount <VMFS-UUID|label> |
--vihost <esx_host>]
DESCRIPTION
The vicfg-volume command supports resignaturing a snapshot volume and mounting and unmounting the volume. You
can also make the mounted volume persistent across reboots and query a list of snapshot volumes and original
volumes.
The ESX Configuration Guide and the ESXi Configuration Guide discuss volume resignaturing in detail.
OPTIONS
connection_options
Specifies the target server and authentication information if required. Run vicfg-volume --help for a list of
all connection options.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--list | -l
Lists all volumes that have been detected as snapshots or replicas.
--persistent-mount | -M [<VMFS-UUID>|<label>]
Mounts a snapshot/replica volume persistently if its original copy is not online.
--resignature | -r [<VMFS-UUID>|<label>]
Resignatures a snapshot/replica volume.
--umount | -u [<VMFS-UUID>|<label>]
Unmounts a snapshot/replica volume.
--vihost | -h
When you run a vCLI command with the --server option pointing to a vCenter Server system, use --vihost
to specify the ESX/ESXi host to run the command against.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-volume --help for a list of common options including connection
options.
List all volumes that have been detected as snapshots/replicas:
vicfg-volume <conn_options> -l
SYNOPSIS
vicfg-vswitch [<connection_options>]
[ --add <switch_name> |
--check <vswitch_name> |
--delete <vswitch_name> |
--get-cdp <vswitch_name> |
--help |
--link <physical_nic> <vswitch_name> |
--list |
--mtu <vswitch_name> |
--set-cdp <vswitch_name> |
--unlink <physical_nic> <vswitch_name> |
--vihost <esx_host ]
vicfg-vswitch [<connection_options>]
[--add_pg <portgroup> <vswitch_name> |
--check-pg <port_group> <vswitch_name> |
--del-pg <port_group> <vswitch_name> |
--help |
--list |
--vihost <esx_host |
--vlan --pg <port_group> ]
vicfg-vswitch [<connection_options>]
[--add-dvp-uplink <adapter_name> --dvp <DVPort_id> <dvswitch_name> |
--del-dvp-uplink <adapter_name> --dvp <DVPort_id> <dvswitch_name> |
--help |
--vihost <esx_host ]
vicfg-vswitch [<connection_options>]
[--add-pg-uplink <adapter_name> --pg <port_group> <vswitch_name> |
--del-pg-uplink <adapter_name> --pg <port_group> <vswitch_name> |
--help |
--vihost <esx_host ]
DESCRIPTION
The vicfg-vswitch command adds or removes virtual switches or modifies virtual switch settings. A virtual switch is an
abstracted network device. It can route traffic internally between virtual machines and link to external networks. The
ESX Configuration Guide and the ESXi Configuration Guide discuss virtual switches, vNetwork Distributed Switches (vDS),
port groups, and vDS port groups. The vSphere CLI manual presents some sample scenarios.
By default,each ESX/ESXi host has a single virtual switch called vSwitch0.
OPTIONS
--add | -a <switch_name>
Adds a new virtual switch.
--add-pg | -A <portgroup> <vswitch_name>
Adds a port group to the specified virtual switch.
--add-dvp-uplink | -P
Adds an uplink adapter to a distributed virtual port (DVP).
--add-pg-uplink | -M
Adds an uplink adapter to a port group (valid for vSphere 4.0 and later). This command fails silently if the uplink
adapter does not exist.
--check | -c <vswitch_name>
Checks whether a virtual switch exists. Prints 1 if the switch exists and prints 0 otherwise. Use the virtual switch
name, e.g. vSwitch0 or vSwitch1, to specify the virtual switch.
--check-pg | -C <port_group> <vswitch_name>
Checks whether the specified port group exists or not.
connection_options
Specifies the target server and authentication information if required. Run vicfg-vswitch --help for a list
of all connection options.
--delete | -d <vswitch_name>
Deletes a virtual switch. Running the command with this option fails if any ports on the virtual switch are in use
by VMkernel networks, vswifs, or virtual machines.
--del-pg | -D <port_group> <vswitch_name>
Deletes a port group from the virtual switch. Running the command with this option fails if the port group is in
use, for example, by a virtual machine or a VMkernel network.
--del-dvp-uplink | -Q <adapter_name > --dvp <DVPort_id> <dvswitch_name> >
Deletes an uplink adapter from a port on a DVS (distributed virtual switch), also called vNetwork Distributed
Switch (vDS). Valid for vSphere 4.0 and later.
--del-pg-uplink | -N <adapter_name > <port_group> <dvswitch_name>
Deletes an uplink adapter from a port group. Valid for vSphere 4.0 and later.
--dvp | -V
Name of a distributed virtual port. Used in conjunction with other options. Valid for vSphere 4.0 and later.
--get-cdp | -b <vswitch_name>
Prints the current CDP (Cisco Discovery Protocol) setting for this virtual switch (valid for vSphere 4.0 and later).
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--link | -L <physical_nic> <vswitch_name>
Adds an uplink adapter (physical NIC) to a virtual switch. Running the command with this option attaches a new
unused physical network adapter to a virtual switch.
--list | -l
Lists all virtual switches and their port groups.
--mtu | -m <vswitch_name>
Sets the MTU (maximum transmission unit) of the virtual switch. This option affects all physical NICs assigned to
the virtual switch.
--pg | -p <port_group>
Provides the name of the port group for the --vlan option. Specify ALL to set VLAN IDs on all port groups of a
virtual switch.
--set-cdp | -B <vswitch_name> [down | listen | advertise | both]
Sets the CDP status for a given virtual switch (valid for vSphere 4.0 and later). To set, specify down, listen,
advertise, or both.
--unlink | -U <physical_nic> <vswitch_name>
Removes an uplink adapter from a virtual switch. An uplink adapter corresponds to a physical Ethernet adapter
to which the virtual switch is connected. If you remove the last uplink adapter, you lose physical network
connectivity for that switch.
--vihost | -h <esx_host>
When you run a vSphere CLI command with the --server option pointing to a vCenter Server system, use --
vihost to specify the ESX/ESXi host to run the command against.
--vlan | -v --pg <port_group>
Sets the VLAN ID for a specific port group of a virtual switch. Setting the option to 0 disables the VLAN for this
port group. If you specify this option, you must also specify the --pg option.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vicfg-vswitch --help for a list of common options including connection
options.
Add a new virtual switch:
vicfg-vswitch <conn_options> -a <vswitch name>
Delete the virtual switch. This will fail if any ports on the virtual switch are still in use by VMkernel networks, vswifs, or
virtual machines:
vicfg-vswitch <conn_options> -d <vswitch name>
SYNOPSIS
vifs [<connection_options>]
[--copy <source> <target> |
--dir <remote_dir> |
--help |
--force |
--get <remote_path> <local_path> |
--listdc |
--listds [--dc <datacenter>] |
--mkdir <remote_dir> |
--move <source> <target> |
--put <local_path> <remote_path> |
--rm <remote_path> |
--rmdir <remote_dir> ]
DESCRIPTION
The vifs command performs common operations such as copy, remove, get, and put on files and directories. The
command is supported against ESX/ESXi hosts but not against vCenter Server systems.
Note: While there are some similarities between vifs and DOS or Unix file system management utilities, there are also
many differences. For example, vifs does not support wildcard characters or current directories and, as a result, relative
path names. Use vifs only as documented.
OPTIONS
connection_options
Specifies the target server and authentication information if required. Run vifs --help for a list of all
connection options
--copy | -c <source> <target>
Copies a file in a datastore to another location in a datastore. The <source> must be a remote source path, the
<target> a remote target path or directory. Use the --force option to replace existing destination files.
--dir | -D <remote_dir>
Lists the contents of a datastore or host directory.
--help
Prints a help message for each command-specific and each connection option. Calling the command with no
arguments or with --help has the same effect.
--force | -f
Overwrites the destination file. Use with --copy and --move.
--get | -g <remote_path> <local_path>
Downloads a file from the ESX/ESXi host to the machine on which you run the vCLI commands. This operation
uses HTTP GET.
--listdc | -c
Lists the datacenter paths available on an ESX/ESXi system.
--listds | -S
Lists the datastore names on the ESX/ESXi system. When multiple datacenters are available, you can use the --
dc|-Z <datacenter> argument to specify the name of the datacenter from which you want to list the
datastore.
--mkdir | -M <remote_dir>
Creates a directory in a datastore. This operation fails if the parent directory of remote_dir does not exist.
--move | -m <source> <target>
Moves a file in a datastore to another location in a datastore. The <source> must be a remote source path, the
<target> a remote target path or directory. The --force option replaces existing destination files.
--put | -p <local_path> <remote_path>
Uploads a file from the machine on which you run the vCLI commands to the ESX/ESXi host. This operation uses
HTTP PUT. This command can replace existing host files but cannot create new files.
--rm | -r <remote_path>
Deletes a file or a directory.
--rmdir | -r <remote_dir>
Deletes a datastore directory. This operation fails if the directory is not empty.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vifs --help for a list of common options including connection options.
Copy a file to another location:
vifs <connection_options> -c "[StorageName] VM/VM.vmx" "[StorageName] VM_backup/VM.vmx"
Delete a file:
vifs <connection_options> -r "[StorageName] VM/VM.txt" -Z "ha-datacenter"
vifs <connection_options> -rmdir "[StorageName] VM/VM.txt" -Z "ha-datacenter"
vihostupdate35 - manage software installation packages on a VMware Infrastructure 3.5 host using vSphere
CLI 4.0 and later.
SYNOPSIS
vihostupdate35 [<connection_options>]
[ --help |
--install [--bundle <zip_location>|--metadata <zip_location>] |
--query |
--remove <bulletin> |
--scan [--bundle <location>|--metadata <zip_location>]]
DESCRIPTION
vihostupdate35 provides an interface to list installed packages on a host, scan for packages that apply to a host, install
packages in a specified directory, unpack a downloaded update, and install an update package.
Run this command only against ESX/ESXi version 3.5 hosts. Run vihostupdate agains ESX/ESXi 4.0 and later hosts.
OPTIONS
--bundle | -b
Location of the offline bundle. Use either -b or -m but not both.
connection_options
Specifies the target server and authentication information if required. Run vihostupdate35 --help for a list
of all connection options.
--force | -f
Always reboot the host after a successful host update.
--help
Prints a help message for each command-specific and each connection option. Calling the command with no
arguments or with --help has the same effect.
--install | -i
Installs an update package from a given directory.
--metadata | -m
Specifies the location of the depot metadata.xml ZIP file that contains information about the update bundle.
Use either -b or -m, not both.
--query | -q
Lists installed packages on the host.
EXAMPLES
Unpack a zip bundle containing the update but do not install the update:
vihostupdate35 <connection_options> -b <bundle zip file>
SYNOPSIS
vihostupdate [<connection_options>]
[ --help |
--install [--bundle <zip_location>|--metadata <zip_location>] |
--list [--bundle <zip_location>|--metadata <zip_location>] |
--query |
--remove <bulletin> |
--scan [--bundle <location>|--metadata <zip_location>]]
DESCRIPTION
The vihostupdate command applies software updates to ESX/ESXi images and installs and updates ESX/ESXi extensions
such as VMkernel modules, drivers, and CIM providers.
The vihostupdate command works with bulletins. Each bulletin consists of one or more vSphere bundles and addresses
one or more issues. A bulletin is considered to be included in another bulletin if every vSphere bundle in the first
bulletin meets one of these criteria:
• The vSphere bundle is included in the second bulletin.
• The vSphere bundle is obsoleted by another bundle in the second bulletin.
Towards the end of a release cycle, bulletins include a large number of other bulletins. Bulletins are available in bundles
and in depots with associated metadata.zip files.
• If you use offline bundles, all patches and corresponding metadata are available as one ZIP file.
• If you use metadata, the metadata.zip file points to metadata. The metadata describes the location of the files.
The command supports querying software installed on a host, listing software in a patch, scanning for bulletins that
apply to a host, and installing all or selective bulletins in the patch. You can specify a patch by using a bundle ZIP file or
the metadata ZIP file of a depot. The depot can be on the remote server, or you can download a bundle ZIP file and use
a local depot.
vihostupdate supports https://, http://, and ftp:// downloads. You can specify the protocols in the download URL for the
bundle or metadata file.
See the ESXi Upgrade Guide for some additional information. For more information about installing, removing, and
updating 3rd-Party extensions in vSphere 4.0, see the Setup Guide. An example is in the EXAMPLES section below.
Important: Do not specify -b or -m more than once. If you do, the command only processes the last file that is specified.
You can specify a comma-separated list of bundles with --install but not with other options. That might be necessary if
you want to install a VMware bundle and a third-party bundle.
OPTIONS
--bulletin | -B <bulletin_list>
Bulletins to install. Use this option together with --bundle or --metadata.
Use a comma-separated list, for example, bulletin1,bulletin2. If this option is not specified, vihostupdate
installs all bulletins.
--bundle | -b <location>
Location of the offline bundle. Use either -b or -m but not both. You can specify a list of bundles separated by
commas but not spaces. That might be necessary if you want to install a VMware bundle and a third-party
bundle. The bundles can be local (e.g. C:\bundle1.zip, C:\bundle2.zip) or remote (e.g.
http://<server>/bundle1.zip, http://<server>/bundle2.zip).
connection_options
Specifies the target server and authentication information if required. Run vihostupdate --help for a list of
all connection options.
--help
Prints a help message for each command-specific and each connection option. Calling the command with no
arguments or with --help has the same effect.
--install | -i [--bundle <location> | --metadata <zip_location>]
Installs the host with selective bulletins from the bundle or the depot. Requires either -b or -m, but not both.
You can specify this parameter only once.
--list | -l [--bundle <location> | --metadata <zip_location>]
Lists the bulletins in the specified bundle or depot. Requires either -b or -m but not both.
--metadata | -m <zip_location>
Specifies the location of the depot metadata.xml ZIP file that contains information about the update bundle.
Use either -b or -m, not both.
--query | -q
Displays all bulletins that are already installed on the host.
--remove | -r <bulletin>
Removes the specified bulletin from the host.
Use this option for removing bulletins that are third-party or VMware extensions. Do NOT remove bulletins that
are VMware patches or updates.
--scan | -s [--bundle <location> | --metadata <zip_location>]
Scans the host for the bundle or the depot for applicable bulletins. Requires either -b or -m but not both.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vihostupdate --help for a list of common options including connection
options.
You can update an ESX/ESXi host using bundles by running the following commands in sequence:
1. Find out which bulletins are installed on your ESX/ESXi host
vihostupdate.pl <conn_options --query
2. Find out which bulletins are available in the bundle
vihostupdate.pl <conn_options> --list --bundle http>//<webserver>/rollup.zip
3. Find out which bulletins in the bundle are applicable to your ESX/ESXi host.
vihostupdate.pl <conn_options> --scan --bundle http://<webserver>/rollup.zip
4. Install all or some bulletins from the bundle on the ESX/ESXi host. The ESX/ESXi host is updated to the specified
patch level.
vihostupdate.pl <conn_options> --install --bundle http://<webserver>/rollup.zip
5. If necessary, you can remove individual bulletins. Use this option only for removing bulletins that are third-party
or VMware extensions. Do not remove bulletins that are VMware patches or updates.
vihostupdate.pl <conn_options> --remove --bulletin bulletin1
You can update your ESX/ESXi host using depots by running the following commands in sequence:
1. List all bulletins in the depot given the metadata.zip file location.
vihostupdate.pl --list --metadata http>//<webserver>/depot/metadata.zip
2. Scan the depot for bulletins that are applicable to the host.
vihostupdate.pl --scan --metadate http://<webserver>/depot/metadata.zip
3. Install bulletins in the depot on the hos.
o To install all bulletins:
vihostupdate.pl --install --metadate http://<webserver>/depot/metadata.zip
o To install selected bulletins, use a comma-separated list. Spaces after the commas are not supported.
vihostupdate.pl --install --metadate http://<webserver>/depot/metadata.zip --
bulletin bulletin1,bulletin
You can deploy a third-party bundle that you have downloaded on your web server, for example:
vihostupdate.pl <conn_options> --install --bundle
https://<3rdParty_webserver>/Cisco_Swordfish.zip
SYNOPSIS
vmkfstools <conn_options> <options> <target>
You use the vmkfstools vSphere CLI to create and manipulate virtual disks, file systems, logical volumes, and physical
storage devices on an ESX/ESXi host. You can use vmkfstools to create and manage a virtual machine file system (VMFS)
on a physical partition of a disk and to manipulate files, such as virtual disks, stored on VMFS-3 and NFS. You can also
use vmkfstools to set up and manage raw device mappings (RDMs).
OPTIONS
GENERAL OPTIONS
connection_options
Specifies the target server and authentication information if required. Run vmkfstools --help for a list of all
connection options.
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
--vihost | -h <esx_host>
When you execute a vCLI with the --server option pointing to a vCenter Server system, use --vihost to
specify the ESX/ESXi host to run the command against.
FILE SYSTEM OPTIONS
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vmkfstools --help for a list of common options including connection
options. The examples use single quotes around some names; use double quotes on Windows.
Create the specified file system:
For ESX/ESXi version earlier than 4.0, specify the VMHBA name:
vmkfstools <conn_options> -C vmfs3 -b 1m -S Test vmhba0:0:0:3
For ESX/ESXi version 4.0 or later, specify the device name, for example naa.xxx:
vmkfstools <conn_options> -C vmfs3 -b 1m -S Test naa.600601604d521c002732ff0dc122dd11:3
Create a virtual disk:
vmkfstools <conn_options> -c 2048m '[storage1] rh6.2.vmdk'
Rename files associated with a specified virtual disk to the specified name:
vmkfstools <conn_options> -E '[storage1] rh6.2.vmdk' '[storage1] testing2.vmdk'
Get the geometry information (cylinders, heads, and sectors) of a virtual disk:
vmkfstools <conn_options> -g '[storage1] testing2.vmdk'
Extend the virtual disk to specified size, the extended region of the disk grows in eagerzeroedthick format:
vmkfstools <conn_options> -X 1g -d eagerzeroedthick '[storage1] rh6.2.vmdk'
SYNOPSIS
General Options
vmware-cmd [--help | -q | -v]
Server Operations
vmware-cmd -s <conn_option>
[-l |
-s register <config_file_path> [<datacenter>] [<resource_pool>] |
-s unregister <config_file_path> ]
DESCRIPTION
vmware-cmd provides an interface to perform operations on a virtual machine. You can retrieve information such as the
power state, register and unregister the virtual machine, set configuration variables, and manage snapshots.
OPTIONS
CONNECTION OPTIONS
The vmware_cmd vSphere CLI command connection options differ from those of most other vSphere CLI commands.
-H <host>
Specifies an ESX/ESXi host or a vCenter Server system.
-h | --vihost <esx_host>
Specifies a target host if the host specified by -H <host> is a vCenter Server system.
-O <port>
Specifies an alternative port. Default is 443
-U <user_name>
Name of the user who connects to the target. This user must have privileges to perform the operation.
-P <password>
Password of the user specified by <username>. Required if a user is specified.
--config <connection_config_file>
Location of a configuration file that specifies connection information.
--credstore <cred_store>
Name of a credential store file.
--sessionfile <session_file>
Name of a session file that was saved earlier using the vSphere SDK for Perl session/save_session.pl script.
--passthroughauth <passthroughauth>
If you specify this option, the system attempts to connect using Microsoft Windows Security Support Provider
Interface (SSPI).
GENERAL OPTIONS
--help
Prints a help message for each command-specific and each connection option. Calling the script with no
arguments or with --help has the same effect.
-q
Turns on quiet mode with minimal output.
-v
Turns on verbose mode.
OPERATIONS
The following operations require that you specify the path to the virtual machine configuration file. Choose one of the
following formats:
Datastore prefix style: [ds_name] <relative_path>
For example:
'[myStorage1] testvms/VM1/VM1.vmx' (Linux)
"[myStorage1] testvms\VM1\VM1.vmx" (Windows)
-l
Lists all registered virtual machines.
-s register <config_file_path[<datacenter>] [<resource_pool>]
Registers a virtual machine.
If -H specifies a vCenter Server system, you must specify the datacenter and the resource pool to register the
virtual machine in. The default datacenter is ha-datacenter and the default resource pool is Resources.
If -H specifies an ESX/ESXi system, you usually do not specify the resource pool and datacenter. However, if two
virtual machines with the same name exist in two resource pools, you must specify the resource pool.
-s unregister
Unregisters a virtual machine.
VIRTUAL MACHINE OPERATIONS
<config_file_path> answer
Prompts the user to answer a question for a virtual machine waiting for user input.
connectdevice <config_file_path> <device_name>
Connects a virtual device to a virtual machine.
<config_file_path> createsnapshot <name> <description> quiesce 0|1 memory 0|1
Creates a snapshot of the specified virtual machine, providing a name and description for the snapshot.
If the <quiesce> flag is 1 and the virtual machine is powered on when the snapshot is taken, VMware Tools is
used to quiesce the file system in the virtual machine. Quiescing a file system is a process of bringing the on-disk
data of a physical or virtual computer into a state suitable for backups. This process might include such
operations as flushing dirty buffers from the operating system's in-memory cache to disk, or other higher-level
application-specific tasks.
If the <memory> flag is 1, a dump of the internal state of the virtual machine is included in the snapshot.
Memory snapshots take longer to create.
<config_file_path> disconnectdevice
Disconnects the specified virtual device from the virtual machine.
<config_file_path> getconfigfile
Returns a string containing the name of the virtual machine configuration file. This command fails if the virtual
machine is not connected.
<config_file_path> getguestinfo
Retrieves the value for a GuestInfo variable. The variable contains the attributes of the guest operating system
of a virtual machine. For example, you can run the following command to retrieve the IP address of a virtual
machine: vmware-cmd <config_file-path> getguestinfo ip You usually use this command when VMware
Technical Support or a VMware Knowledge Base article instruct you to do so.
<config_file_path> getproductinfo
Returns information about the product, where <prodinfo> is product, platform, build, majorversion (product
major version number), or minorversion (product minor version number). If product is specified, the return
value is one of the following:
esx -- VMware ESX
embeddedESX -- VMware ESXi
unknown (unknown product type)
<config_file_path> getstate
Retrieves the execution state of a virtual machine. The state can be on, off, suspended, or unknown.
<config_file_path> gettoolslastactive
Returns an integer indicating how much time has passed, in seconds, since the last heartbeat was detected from
the VMware Tools service. This value is initialized to zero when the virtual machine powers on. It stays at zero
until the first heartbeat is detected. After the first heartbeat, the value is always greater than zero until the
virtual machine is power cycled again. The command can return one of the following:
• 0 -- VMware Tools are not installed or not running.
• 1 -- Guest operating system is responding normally.
• 5 -- Intermittent heartbeat. There might be a problem with the guest operating system.
• 100 -- No heartbeat. Guest operating system might have stopped responding
<config_file_path> getuptime
Returns the uptime (in seconds) of the guest operating system on the virtual machine.
<config_file_path> hassnapshot
Returns 1 if the virtual machine already has a snapshot. Returns 0 otherwise.
<config_file_path> removesnapshots
Removes all snapshots belonging to the virtual machine. If no snapshot exists, does nothing.
<config_file_path> reset [soft|hard]
Shuts down, and then reboots a virtual machine. The powerop_mode can be hard or soft. Default is soft.
<config_file_path> revertsnapshot
Reverts the virtual machine to the current snapshot. If no snapshot exists, does nothing and leaves the virtual
machine state unchanged.
<config_file_path> setguestinfo<variable> <value>
Writes a GuestInfo variable into memory. This is an advanced command. You usually use this command when
VMware Technical Support or a VMware Knowledge Base article instruct you to do so.
<config_file_path> start
Powers on a previously powered-off virtual machine or resumes a suspended virtual machine.
<config_file_path> stop
Shuts down and powers off a virtual machine. The powerop_mode can be hard or soft. Default is soft.
<config_file_path> suspend [soft|hard]
Suspends a virtual machine. The default powerop_mode is soft.
EXAMPLES
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying
the server, user name, and password. Run vmware-cmd --help for a list of common options including connection
options.
SERVER OPERATIONS
Power on a virtual machine with 'soft' power mode (requires VMware Tools):
vmware-cmd <connection_options>
/vmfs/volumes/storage1/MyVM/MyVM.vmx start soft
Retrieve the value for a guest info variable for a virtual machine:
vmware-cmd <connection_options>
/vmfs/volumes/storage1/MyVM/MyVM.vmx getguestinfo VarABC
DATACENTER OPERATIONS
You can perform any of the datacenter operations on a vCenter Server system by specifying the vCenterServer system
using the -H option and the ESX/ESXi host using the --vihost | -h option. To register a virtual machine on a vCenter
Server system, you have to specify the datacenter and resource pool name. For example:
Register a virtual machine.
vmware-cmd -U <myuser> -P <mypassword> -H VCServerABC --vihost ESXHost
-s register /vmfs/volumes/storage1/MyVM/MyVM.vmx DatacenterA PoolC
Create a snapshot.
vmware-cmd -U <myuser> -P <mypassword> -H VCServerABC -h ESXHost
/vmfs/volumes/storage1/MyVM/MyVM.vmx createsnapshot <name> <description>
<quiesce> <memory>