Book Image

VMware vSphere 5.5 Cookbook

By : Abhilash G B
Book Image

VMware vSphere 5.5 Cookbook

By: Abhilash G B

Overview of this book

Table of Contents (22 chapters)
VMware vSphere 5.5 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 2 – issuing commands by specifying a target server

  1. Issue the command specifying the server name.

    Example:

    esxcli --server host001.vdescribed.lab iscsi adapter list
    vifptarget -s host001.vdescribed.lab
    
  2. Supply the username and password when prompted:

Method 3 – issuing commands against a vCenter added as the target

  1. Issue the command specifying the vCenter Server and ESXi...