Archive

Archive for the ‘PowerCLI’ Category

VMware PowerCLI 5.01 released adding vCloud Director Automation

January 10th, 2012 No comments

VMware has released what at first looks like a minor update to their PowerShell snapin, PowerCLI to version 5.01. Although just a .01 release which brings the usual changes and bug fixes which are listed here,  the big news is that VMware has added a whole bunch of cmdlets for managing vCloud Director.

A whole new snapin has been created called VMware.VimAutomation.Cloud and this initial release focuses more on the reporting side, so being able to retrieve information from vCD rather than setting things but also does have cmdlets for importing VMs, Templates and .OVFs from vSphere into your vCD environment. This is a great step forward as cloud computing relies so much on automation and having PowerCLI also available means you have so many more options to tie together your automation workflows.

Read more…

SRM for free with PowerCLI & DataONTAP– Part 2: iSCSI

September 14th, 2011 1 comment

My updated previous NFS post talked about implementing part of the functionality of SRM in Powershell using PowerCLI and NetApp’s DataONTAP for NFS datastores.

This post is an update to my previous iSCSI post in which I had only looked at the VMware side of the automation and so it’s time for an update to include the important part of handling the underlying storage. I’m going to use NetApp storage as an example but any storage vendor that exposes their API to Powershell can be used if you can find the relevant commands.

You will obviously need both PowerCLI and Netapp’s DataONTAP installed. See my previous post: Pimping your Powershell Profile for getting everything installed.

For the storage automation, all you really have to do is connect to the filer and then quiesce and break the storage mirror so it is writeable at the BR site. After you’ve connected this is a single line:

Get-NaSnapmirror "FilerName" | Invoke-NaSnapmirrorQuiesce | Invoke-NaSnapmirrorBreak -Confirm:$false

Read more…

What’s new in VMware vSphere PowerCLI 5.0

August 25th, 2011 No comments

Today’s the day that vSphere 5 has officially been released.  There are going to be a million other blog posts talking at length about the full release of vCenter, ESXi, new licensing etc. so I’ll avoid repeating what everyone else is saying.

However, as part of the vSphere 5 release, vSphere PowerCLI 5.0 has also been released and since the vSphere 5 announcement, I haven’t noticed anything written as yet about the new PowerCLI. VMware is consolidating their API

vSphere PowerCLI 5.0 can be downloaded from here.

The changelog has a detailed list of all the changes but it’s probablky a little easier to see the Release Notes:

Read more…

SRM for free with PowerCLI & DataONTAP– Part 1: NFS

August 16th, 2011 1 comment

I’ve blogged before on how you can use PowerCLI to replicate some of the functionality of VMware’s SRM to easily recover VMs in a business recovery site with replicated storage.

In my previous post I had only looked at the VMware side of the automation and so it’s time for an update to include the important part of handling the underlying storage. I’m going to use NetApp storage as an example but any storage vendor that exposes their API to Powershell can be used if you can find the relevant commands.

This is where the awesomeness of Powershell really comes into its own when you can combine automation for both VMware and NetApp in a single script.

You will obviously need both PowerCLI and Netapp’s DataONTAP installed. See my previous post: Pimping your Powershell Profile for getting everything installed.

Read more…

Adding .VMX Files to vCenter Inventory with PowerCLI gets even easier

August 11th, 2011 2 comments

Update: I’ve since found out that mattboren actually found out about this before me and posted something on the VMware communities which I missed. Well found Matt.

A fairly common request is to be able to register existing VMs in a datastore in the vCenter inventory.

This can be a life saver if you have had storage issues and have had to present a backup copy of a datastore which has a different name and need to add the VMs to the inventory, a very laborious process if done manually with right-click Add to Inventory.

This can also be useful in a business recovery process when you need to add VMs that have been mirrored by storage replication over to a secondary site and you need to add them into your inventory.

PowerCLI guru, Luc Dekens has developed a fantastic script called Raiders of the Lost VMX which searches a datastore for .VMX files, and adds them to the vCenter inventory. This script has been updated over the years with even more clever functionality.

Adding the VM to the inventory involved running the RegisterVM_Task Method against the VM Folder in VC.

By accident I discovered there’s actually an updated easier way to add existing VMs to the inventory if you have the .VMX file path. I’m not sure when this was added to PowerCLI but I found it when writing a script to add a new VM.

Read more…

NetApp PowerShell Toolkit, DataONTAP 1.5 released

August 4th, 2011 No comments

NetApp has updated it’s Powershell Toolkit which it calls DataONTAP to version 1.5 (I think PowerONTAP would be a much better name!).

You will need a Netapp NOW account which is available to customers and partners to download the toolkit.
http://communities.netapp.com/community/interfaces_and_tools/data_ontap_powershell_toolkit

There are 27 new cmdlets taking the total up to a massive 528 cmdlets with nearly all possible API’s now covered.

Read more…

Thinking, Building and Scripting Globally – a London VMUG presentation.

July 14th, 2011 2 comments

I have the privilege today of presenting at the London VMware User Group.

My presentation is split into two parts, first of all looking at why setting standards, creating processes and adding automation is now more important than ever as we work towards building an infrastructure for cloud computing.

I go through how “cloud thinking” is not just about the cloud being used to solve an IT problem but rather the cloud being a busines transformation to increase your business flexibility.

Your ESX(i) host build is the foundation of that cloud.

Then I head into the technical details of how to create a single PowerCLI script to build ESX or ESXi anywhere in your organisation. Using PowerCLI removes the dependency on any Service Console scripting so you can move towards an ESXi only infrastructure as that is the only hypervisor option for vSphere 5.

Having a single global script allows you to set standards and gives you way to reduce complexity & errors.

Read more…

Installing HP Agents on ESX with PowerCLI and Putty/Plink

March 7th, 2011 2 comments

Anyone who needs to build multiple ESX(i) hosts naturally looks to scripting to automate the process. Scripting allows for faster deployment once you have developed the script but equally important reduces human error. It’s far to easy to mistype a port group name, vlan number or IP address. Scripting removes this element of humen error and allows you to build ESX(i) hosts preditably and quickly.

Unfortunately there are just some things that PowerCLI cannot natively automate such as installing HP agents on ESX as this requires console / SSH access to the ESX host and running the install “locally”.

Hopefully hardware vendors will see the benefits of integration with VMware Update Manager and allow hardware monitoring agents to be installed and updated with Update Manager but until then we have to make another plan.

It is always painful to have developed a fantastic PowerCLI script to automate your build and at the end still have to manually SSH into your ESX host to install a hardware agent.

Read more…

Scripting Flex-10 ESX design with PowerCLI

February 18th, 2011 No comments

My Flex-10 ESX design with simplicity and scalability posts detail the configuration steps required to deploy ESX with Flex-10. There’s a lot of clicking around in the vSphere client that can be automated with PowerCLI.

The steps below will set up the ESX networking component as described in the design posts so can be incorporated into the rest of your PowerCLI build process.

Read more…

Getting Nic firmware versions with PowerCLI

January 27th, 2011 1 comment

Sometimes you need to delve into the innards of ESX to get information out that just isn’t available through the VMware SDK and so not directly available to PowerCLI.

If you’ve been doing any work recently with HP Flex-10 and its firmware requirements, you may need to find out the network card firmware version which is only available from within the ESX console by typing ethtool -i vmnic0

So, PowerCLI to the rescue, but actually using PowerCLI to call Plink.exe which is Putty’s command-line connection tool. You can use this same process to pull anything that you can get from the ESX console as long as you can parse the results of the command and find the information you need.

Read more…