You may find when you add a new host to your vSphere environment and discover any datastores presented to the host, the multipathing policy will be automatically set to MRU (Most Recently Used). For best performance it’s recommended to change this policy to Roundrobin, however this is a very manual and tedious task of adjusting each datastore on each host.
To speed this process up, below you can find a PowerCLI command that will set all datastores on a specific host to Roundrobin.
This post will detail how to upgrade VMware tools on virtual machines without having to reboot by using PowerCLI. Personally I have found this quite useful when having to upgrade VMware tools on production servers that require 24×7 up time. I have tried this update method on Windows Server 2008/R2 and RHEL 5/6 with success.
First you need to connect to your vCenter server via PowerCLI and choose one of the two methods of deployment detail below.
Upgrade VMware tools on a singular virtual machine:
Get-VM “yourvm” | Update-Tools –NoReboot
Upgrade VMware tools on all virtual machines:
Get-VM | Update-Tools –NoReboot
Thanks for reading and remember to lookout for my other posts on PowerCLI.
In this post I will explain how to run a PowerCLI command to connect or disconnect all virtual machine network adapters. Recently I experienced a power failure in one of my data centres that took out one of my SANs as well a host that held my vCenter server. When the kit was powered back on and vCentre was responding, an odd occurrence took place where all virtual machines managed by this vCenter server had the “Connect On Power On” check box enabled but the “Connected” check box wasn’t. At the time the only way to rectify this issue was to manually go though each virtual machine and check the box for the adapter to be connected. Not a fun experience.
To avoid the requirement for manual intervention to solve this issue for each virtual machine in the future, I have put together a PowerCLI command that will run though all virtual machines and connected their respective network adapters.
To do so, first load PowerCLI and connect to your vCenter server with the following command:
Following this, run the below command. This will run through all virtual machines managed by vCentre and connect network adapters 1 and 2. You can add additional adapters to be connected by simply adding more into the command e.g. “Network adapter 3″,”Network adapter 4” etc.
In this post we’ll go over writing a View PowerCLI script to schedule a recompose of a desktop pool.
If your like most VMware View administrators you’ll probably use linked clones, and know that now and again these clones will need recomposing to keep up to date with operating system patches or updates for embedded applications. If your organisation is like mine and operates on a 24 hours basis, getting downtime to perform a recompose can end up being headache and is usually scheduled for a unsavory hour.
Unfortunately scheduled tasks was not part of the View v5 release which i imagine left many people in my situation slightly disappointed. To get around this need for functionality, i turned to the View PowerCLI extensions and wrote a script to perform my desired tasks.
Below you will fine my script, along with one of my working examples that allows you to specify a linked clone pool to be recomposed from a specific virtual machine and snapshot at a defined time and date.
In this post I will detail how to make use of the VMware View PowerCLI extensions. One feature I has hoping to see in the release of VMware View 5 was the ability to schedule tasks such as refreshing desktops or recomposing entire pools. Unfortunately this feature wasn’t added to View so i seeked my own solution. With View PowerCLI you can perform most if not all main functionality and better still, schedule when you went these commands to run. In this post the relevant commands for scheduling the refresh of a pool at a defined time are outlined.
VMware PowerCLI can be a very powerful tool in managing your vSphere environment. To get started there are two installs you will need to download and execute on to either a server or workstation that has visibility of your vSphere environment. Once installed you’ll be able to experiment with scripting commands and scheduling tasks. Remember to look out for a later post on using PowerCLI scripts with VMware Site Recovery Manager.