Running CLI command on target servers
In this recipe we will learn how to issue commands on the added target servers.
How to do it…
The following procedures explain how to set a target server to direct commands to it. We will discuss all three methods.
Method 1 – Issue commands on the default target
Set the intended server as the default target for all commands.
Command:
vifptarget –s <servername>
Example:
vifptarget –s esx01.vdescribed.com vifptarget –s vcenter5x.vdescribed.com
Similar to the CLI commands you would run at an ESXi host's console.
Example:
esxcli network nic list
Method 2 – Issue commands by specifying a target server
Issue the command specifying the server name.
Example:
esxcli –server esx01.vdescribed.com iscsi adapter list vifptarget -s esx01.vdescribed.com
Supply the username and password when prompted.
Method 3 – Issuing commands against a vCenter Server added as the target
Issue the command specifying the vCenter Server and ESXi server:
Command:
esxcli --server <VC_server...