Information Technology Reference
In-Depth Information
Using vSphere Management Assistant for Automation
with vCenter
Leveraging the fastpass technology with vCenter allows you a simple luxury: You no longer
have to add each host to fastpass. However, there is a caveat that you must specify an additional
command-line parameter for each command.
This has both advantages and disadvantages. It's extremely convenient to no longer be con-
cerned about whether the host you are manipulating has been initialized for fastpass. Scripts
that are written can simply use the vCenter credentials to manipulate host settings while still
being logged in vCenter's task list. Additionally, all tasks executed through vCenter are logged
in vCenter for auditing purposes. The downside is losing the ability to use legacy scripts that
assume you are on the console of the host and have not had the additional parameter set.
Connecting vCenter to fastpass is the same as it is for hosts. vMA is kind enough to warn you
that storing the vCenter credentials is a security risk, and we do recommend you use vCenter's
role-based access to limit the permissions to the minimum needed. That being said, you should
always protect your vMA as you would any other server in your environment and ensure that
a sufi ciently complex password is used for the vi-admin user to prevent unauthorized access.
Keep in mind that should the vMA become compromised, all of the hosts that are fastpass
enabled are also compromised. You should use the same command for vCenter as for your
ESXi hosts:
vi-admin@vma01:~> vifp addserver vCenter01
Enter username for vCenter01: fp_admin
fp_admin@vCenter01's password:
This will store username and password in credential store which is
a security risk. Do you want to continue?(yes/no): yes
vi-admin@vma01:~> vifp listservers
vCenter01.vSphere.local vCenter
vi-admin@vma01:~> vifptarget -s vCenter01
vi-admin@vma01:~[vCenter01.vSphere.local]>
Notice that you can set the fastpass target server to vCenter just as you can an ESXi host, and
you can execute standard host commands against it as well:
vi-admin@vma01:~[vCenter01.vSphere.local]> vicfg-vswitch -l
The --vihost option must be specified when connecting to vCenter.
For a summary of command usage, type '/usr/bin/vicfg-vswitch --help'.
For documentation, type 'perldoc /usr/bin/vicfg-vswitch'.
But wait! There's an error. Notice that you must specify which ESXi host you want to actu-
ally execute the command against now that you are connecting to vCenter. Following the rec-
ommendation of the error message, you specify the host using the --vihost or -h option and
execute the command:
vi-admin@vma01:~[vCenter01.vSphere.local]> vicfg-vswitch -h vSphere01 -l
Switch Name Num Ports Used Ports Configured Ports MTU Uplinks
vSwitch0 128 3 128 1500 vmnic0
PortGroup Name VLAN ID Used Ports Uplinks
VM Network 0 0 vmnic0
Management Network 0 1 vmnic0
 
Search WWH ::




Custom Search