- Stopping, Rebooting and Examining Hosts with vicfg-hostops
- Entering and Exiting Maintenance Mode with vicfg-hostops
In Windows, vicfg-hostops.pl is used.
C:\>vicfg-hostops.pl --server esx1.virtuallab.com --username root --password esxsvr40 --operation info
Host Name | : esx1.virtuallab.com |
Manufacturer | : VMware, Inc. |
Model | : VMware Virtual Platform |
Processor Type | : Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz |
CPU Cores | : 2 CPUs x 2087 GHz |
Memory Capacity | : 2047 MB |
VMotion Enabled | : no |
In Maintenance Mode | : no |
Last Boot Time | : 2011-10-04T09:30:29.668805+09:00 |
C:\>vicfg-hostops.pl --server esx1.virtuallab.com --username root --password esxsvr40 --operation enter Host esx1.virtuallab.com entered into maintenance mode successfully. C:\>vicfg-hostops.pl --server esx1.virtuallab.com --username root --password esxsvr40 --operation info
Host Name | : esx1.virtuallab.com |
Manufacturer | : VMware, Inc. |
Model | : VMware Virtual Platform |
Processor Type | : Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz |
CPU Cores | : 2 CPUs x 2087 GHz |
Memory Capacity | : 2047 MB |
VMotion Enabled | : no |
In Maintenance Mode | : yes |
Last Boot Time | : 2011-10-04T09:30:29.668805+09:00 |
Host Name | : esx1.virtuallab.com |
Manufacturer | : VMware, Inc. |
Model | : VMware Virtual Platform |
Processor Type | : Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz |
CPU Cores | : 2 CPUs x 2087 GHz |
Memory Capacity | : 2047 MB |
VMotion Enabled | : no |
In Maintenance Mode | : no |
Last Boot Time | : 2011-10-04T09:30:29.668805+09:00 |
Synopsis: /usr/bin/vicfg-hostops OPTIONS
Command-specific options:
--action
-a
"Specify the action for powered on virtual machine (poweroff | suspend). Default is suspend."
--cluster
-c
"Name of the cluster (optional)."
--datacenter
-d
"Name of the datacenter (optional)."
--force
-f
"Optional for reboot and shutdown operation. Flag to force the host that is not in maintenance mode
to be rebooted/shutdown. If not specified, operation will fail for host not in maintenance mode."
--operation (required)
-o
"Operation to perform (enter | exit | reboot | shutdown | info)."
--vihost
-h
"The host to use when connecting via Virtual Center."
Common VI options:
--config (variable VI_CONFIG)
Location of the VI Perl configuration file
--credstore (variable VI_CREDSTORE)
Name of the credential store file defaults to
--encoding (variable VI_ENCODING, default 'utf8')
Encoding: utf8, cp936 (Simplified Chinese), iso-8859-1 (German), shiftjis (Japanese)
--help
Display usage information for the script
--passthroughauth (variable VI_PASSTHROUGHAUTH)
Attempt to use pass-through authentication
--passthroughauthpackage (variable VI_PASSTHROUGHAUTHPACKAGE, default 'Negotiate')
Pass-through authentication negotiation package
--password (variable VI_PASSWORD)
Password
--portnumber (variable VI_PORTNUMBER)
Port used to connect to server
--protocol (variable VI_PROTOCOL, default 'https')
Protocol used to connect to server
--savesessionfile (variable VI_SAVESESSIONFILE)
File to save session ID/cookie to utilize
--server (variable VI_SERVER, default 'localhost')
VI server to connect to. Required if url is not present
--servicepath (variable VI_SERVICEPATH, default '/sdk/webService')
Service path used to connect to server
--sessionfile (variable VI_SESSIONFILE)
File containing session ID/cookie to utilize
--url (variable VI_URL)
VI SDK URL to connect to. Required if server is not present
--username (variable VI_USERNAME)
Username
--verbose (variable VI_VERBOSE)
Display additional debugging information
--version
Display version information for the script
Backing Up Configuration Information with vicfg-cfgbackup
C:\>vicfg-cfgbackup.pl --server esx1.virtuallab.com --username root --password esxsvr40 --save
Operation not supported on this host.
This will not work on ESX host.
C:\>vicfg-cfgbackup.pl --server esx2.virtuallab.com --username root --password esxsvr40 --save
a backup file name must be specified when saving.
For a summary of command usage, type 'C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vicfg-cfgbackup.pl --help'.
For documentation, type 'perldoc C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vicfg-cfgbackup.pl'.
This will work on ESXi host but there is missing parameter.
Try again with correct parameter.
C:\Users\Administrator.W2K8PDC>vicfg-cfgbackup.pl --server esx2.virtuallab.com --username root --password esxsvr40 --save esx2cfg.save
Saving firmware configuration to esx2cfg.save ...
C:\>dir
Volume in drive C has no label.
Volume Serial Number is 8824-A01A
Directory of C:\Users\Administrator.W2K8PDC
10/04/2011 04:41 PM <dir> .
10/04/2011 04:41 PM <dir> ..
09/16/2011 01:37 PM <dir> Contacts
09/21/2011 12:46 PM <dir> Desktop
09/21/2011 12:45 PM <dir> Documents
09/16/2011 01:37 PM <dir> Downloads
10/04/2011 04:41 PM 45,806 esx2cfg.save
09/26/2011 04:47 PM 0 esxcli.log
09/16/2011 01:37 PM <dir> Favorites
09/16/2011 01:37 PM <dir> Links
09/16/2011 01:37 PM <dir> Music
09/16/2011 01:37 PM <dir> Pictures
09/16/2011 01:37 PM <dir> Saved Games
09/16/2011 01:37 PM <dir> Searches
09/16/2011 01:37 PM <dir> Videos
2 File(s) 45,806 bytes
13 Dir(s) 20,258,390,016 bytes free
C:\Users\Administrator.W2K8PDC>vicfg-cfgbackup.pl --help
Synopsis: C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vicfg-cfgbackup.pl OPTIONS [<backupfile>]
Command-specific options:
--force
-f
Force the restore of the configuration.
--load
-l
Restore configuration onto the host
--quiet
-q
Do not prompt for user confirmation.
--reset
-r
Resets host, restore to factory settings.
--save
-s
Backup the host configuration.
Common VI options:
- Managing Host Updates with vihostupdate
---------Bulletin ID--------- -----Installed----- ----------------Summary-----------------
ESX410-Update01 2011-09-21T08:29:58 VMware ESX 4.1 Complete Update 1
C:\>vihostupdate.pl --help
Synopsis: C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vihostupdate.pl OPTIONS
Command-specific options:
--bulletin
-B
Parameter to specify the selective bulletin(s) to install. Use
comma to specify multiple bulletins (eg. bulletin1,bulletin2).
All bulletins will be installed if this option is not specified.
--bundle
-b
Parameter to specify the location of the offline bundle. For install operation, multiple
offline bundles can be specified using comma separator with no space (eg. bundle1,bundle2).
--install
-i
Install the host with selective bulletins from the bundle, the depot or local offline bundle.
--list
-l
List the bulletins in the bundle or in the depot.
--metadata
-m
Parameter to specify the location of the depot metadata.zip
--nosigcheck
-c
Ignore integrity checking during install operation (unsupported).
--query
-q
Query the bulletins that are already installed in the host.
--remove
-r
Remove selective bulletins from the host.
--scan
-s
Scan the host against the bundle or the depot for applicable bulletins.
Common VI options:
Managing VMkernel Modules with vicfg-module
C:\>vicfg-module.pl --server esx1.virtuallab.com --username root --password esxsvr40 --query
Name | ID | Loaded |
vmkernel | 0 | Yes |
vmkapiv1_0_0_0_vmkernel_shim | 1 | Yes |
vmklinux | 2 | Yes |
random | 3 | Yes |
dm | 4 | Yes |
nmp | 5 | Yes |
vmw_satp_local | 6 | Yes |
vmw_satp_default_aa | 7 | Yes |
vmw_psp_lib | 8 | Yes |
vmw_psp_fixed | 9 | Yes |
vmw_psp_rr | 10 | Yes |
vmw_psp_mru | 11 | Yes |
vmw_psp_fixed_ap | 12 | Yes |
vmw_satp_alua | 13 | Yes |
vmw_satp_cx | 14 | Yes |
libata | 15 | Yes |
mask_path_plugin | 16 | Yes |
vaai_filter | 17 | Yes |
vmw_vaaip_emc | 18 | Yes |
vmkapiv1_0_0_0_nmp_shim | 19 | Yes |
vmci | 20 | Yes |
iscsi_trans | 21 | Yes |
hub | 22 | Yes |
netsched | 23 | Yes |
e1000 | 24 | Yes |
iscsi_linux | 25 | Yes |
ata_piix | 26 | Yes |
mptspi | 27 | Yes |
lvmdriver | 28 | Yes |
deltadisk | 29 | Yes |
multiextent | 30 | Yes |
dvsdev | 31 | Yes |
etherswitch | 32 | Yes |
shaper | 33 | Yes |
cdp | 34 | Yes |
tcpip3 | 35 | Yes |
cosShadow | 36 | Yes |
dvfilter | 37 | Yes |
vmkapiv1_0_0_0_dvfilter_shim | 38 | Yes |
vmfs3 | 39 | Yes |
nfsclient | 40 | Yes |
vmkstatelogger | 41 | Yes |
migrate | 42 | Yes |
cbt | 43 | Yes |
iscsi_vmk | 44 | Yes |
pclassify | 45 | Yes |
Synopsis: C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vicfg-module.pl OPTIONS [
Command-specific options:
--get-options
-g
Get the option string configured to be passed to the module
when it is loaded.
--list
-l
List the set of modules on the host (valid for vSphere 4.0 and later).
--query
-q
Query enabled modules options (valid for vSphere 4.0 and later).
--set-options
-s
Set the option string to be passed to the module when it is loaded.
--vihost
-h
The host to use when connecting via Virtual Center (valid for vSphere 4.0 and later)
Common VI options:
Using vicfg-authconfig for Active Directory Configuration
C:\>vicfg-authconfig.pl --help
Synopsis: C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vicfg-authconfig.pl OPTIONS
Command-specific options:
--adpassword
-w
Active Directory password. To be used in conjunction with joindomain option.
--adusername
-U
Active Directory username. To be used in conjunction with joindomain option.
--authscheme
-t
Specify the type of authenticaton scheme. Currently only AD is supported.
--currentdomain
-c
Prints out the currently joined domain.
--force
-f
This flag is only used with leavecurrentdomain option. If specified, any
permissions on entities for AD users will be deleted. If not specified and such
permissions exist, the operation will fail.
--getremoteauthstore
-a
Prints out only the active authentication mechanism.
--joindomain
-j
Join a particular Active Directory domain.
--leavecurrentdomain
-L
Leaves the current Active Directory domain.
--listauthstores
-l
Prints out the different authentication mechanisms supported.
--vihost
-h
The host to use when connecting via Virtual Center.
Common VI options:
No comments:
Post a Comment