Running CLI commands on target servers

In this recipe, we will learn how to issue commands on the added target vCenter Servers or ESXi hosts.

How to do it…

The following procedures explain how to set a target server and issue direct commands to it. We will discuss all three methods.

Method 1 – issuing commands on the default target

  1. Set the intended server as the default target for all commands.

    Command:

    vifptarget –s <servername>
    

    Example:

    vifptarget –s host001.vdescribed.lab
    vifptarget –s vcenterhost001.vdescribed.lab
    
  2. Similar to the CLI commands, you would run at an ESXi host's console.

    Example:

    esxcli system version get
    
    Method 1 – issuing commands on the default target

Method 2 – issuing commands by ...

Get VMware vSphere 5.5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.