Book Image

VMware vSphere Troubleshooting

Book Image

VMware vSphere Troubleshooting

Overview of this book

VMware vSphere is the leading server virtualization platform with consistent management for virtual data centers. It enhances troubleshooting skills to diagnose and resolve day to day problems in your VMware vSphere infrastructure environment. This book will provide you practical hands-on knowledge of using different performance monitoring and troubleshooting tools to manage and troubleshoot the vSphere infrastructure. It begins by introducing systematic approach for troubleshooting different problems and show casing the troubleshooting techniques. You will be able to use the troubleshooting tools to monitor performance, and troubleshoot issues related to Hosts and Virtual Machines. Moving on, you will troubleshoot High Availability, storage I/O control problems, virtual LANS, and iSCSI, NFS, VMFS issues. By the end of this book, you will be able to analyze and solve advanced issues related to vShpere environment such as vcenter certificates, database problems, and different failed state errors.
Table of Contents (16 chapters)
VMware vSphere Troubleshooting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Installing VMware vRealize Operations Manager
Power CLI - A Basic Reference
Index

Appendix C. Power CLI - A Basic Reference

Log in to https://my.vmware.com/web/vmware/login and download the VMware vSphere PowerCLI 6.0 release 1 or release 2. We have used the PowerCLI 6.0 R 1 in this appendix, but R 2 is publically available to download:

Double click on the downloaded file to start the installation wizard, as shown in the following screenshot:

Click on Next and accept the following agreement:

In the next window, you can choose the features that you would like to install. In previous versions of PowerCLI, vCloud or vCD PowerCLI, these features are not installed by default. In PowerCLI 6.0, vCloud Air/vCD PowerCLI is already enabled by default. We will install vCD PowerCLI as we have a vCloud Director installed. You can choose to disable it according to your environment. Click on Next:

And then, click on Install:

Click on Finish once the installation wizard is completed:

Open the installed vSphere PowerCLI via the shortcut on your desktop. You will be presented with a welcome message and some basic commands as a reference to start with, as shown in the following screenshot:

Before we start executing scripts or running commands, we need to check the execution policy. To check that, we can type the following command in our PowerCLI of vSphere or Windows PowerShell:

Get-ExecutionPolicy

If it is set to restricted, which is the default policy, you will not need to execute scripts. To enable it, type the following, as shown in the next screenshot, and type Y to accept it:

Set-ExecutionPolicy –ExecutionPolicy RemoteSigned

To connect to a vCenter Server, type the following:

Connect-VIServer 10.5.2.229

Once prompted, enter your username and password, and click on OK. You will see the output in the PowerCLI of the vCenter Server Name or IP address, the port it is connected to, and the user name that is being used for the connection:

You can see the list of recently connected vCenter Servers or vSphere hosts by typing the following command:

Connect-VIServer - Menu

Now the vCenter Server is connected to retrieve a list of virtual machines currently hosted. To do this, you can type the following:

Get-VM

You can see the list of virtual machines in the following screenshot:

To get more information about the hard disk of the vCenter005 virtual machine, type the following:

Get-VM –Name vCenter005 | Get-HardDisk

To list modules, type the following:

Get-Module -ListAvailable VMware*

The Get-Module command will list all the available modules to be imported in PowerCLI.