VMware

February 03, 2012

Checking the Pay-As-You-Go MHz Issue

Whilst sitting in a vCD Deep Dive presentation by Aidan Dalgliesh and David Hill last week at the London VMUG they explained an issue which has been reported on multiple occasions, they have seen this more than once on customer deployments and the issue had been reported on the internet both by Massimo Re Ferre and Kendrick Coleman.

When setting up a new Organization vDC with a Pay-As-You-Go model the default vCPU Speed is set to 0.26 GHz, most people continue on through the wizard without changing this and end up crippling their VMs as this adds a CPU limit onto the VM meaning the VM will never get past this speed limit.

image

This of course gives us a great reason to produce a one-liner from the PowerCLI vCD snapin to check your complete cloud infrastructure for any Organization vDCs which may have this default still enabled.

Get-OrgVdc | Where {$_.AllocationModel -eq "PayAsYouGo"} | Where {$_.ExtensionData.VCpuInMhz -eq 260}

As you can see, the above one-liner firstly grabs all Organization vDCs and then checks these to see if their allocation model is “PayAsYouGo”, once it has found these it will check the vCPUInMHZ property to see if it is set to 260 or 0.26GHz.

An example of this can be seen below:

SNAGHTML4b994843


January 20, 2012

PowerCLI 5.0.1 vCloud Director Basic Usage

In the recent release of PowerCLI 5.0.1 we introduced a new PowerShell snapin which allows you to work with VMware vCloud Director, to help you get started with these cmdlets and show some basic examples we have recorded the below video.

In this video we will show you how to connect to your vCloud Director instance and how to do basic information gathering tasks using the “Get-“ cmdlets, in future videos and blog posts we will show you how to take this further and introduce more cmdlets and ways to work with vCloud Director.


January 09, 2012

PowerCLI 5.0.1 Released with vCloud Director Automation

Today PowerCLI 5.0.1 has been released. Normally with a .0.1 release you will see small bug fixes and performance increases. This is the case with this release, there are indeed bug fixes and performance increases but there is also something very exciting… PowerShell Cmdlets for managing VMware’s cloud solution – VMware vCloud Director.

The latest bug fixes and other enhancements can be found in the change log here, this post will mainly cover what's new from the vCD PowerCLI snapin or VMware.VimAutomation.Cloud snapin.

vCloud Director Cmdlets

With the addition of vCloud Director Cmdlets to the PowerCLI snapin administrators are now able to automate their cloud deployments and report on key metrics. Using PowerShell's ability to easily integrate with other applications and export to multiple media types, vCloud Director can now be expanded with simple easy to understand code designed towards the system administrator.

Included in PowerCLI 5.0.1 you will now see a new snapin called VMware.VimAutomation.Cloud, this will contain the cmdlets used for working with your vCloud Director deployment. This initial release of the cmdlets will mainly focus on the reporting aspect of vCD or the “Get Cmdlets”. History has shown us that this is a place where most administrators start with a new PowerShell cmdlets as it is easy and safe – you are not going to accidently cause any issues just by reading data!

As well as the “Get Cmdlets” you will also be able to use cmdlets designed for importing virtual machines from the underlying vSphere environments and searching cmdlets which will allow you to search for specific objects within your cloud.

Advanced users of PowerCLI will be familiar with the Get-View Cmdlet currently available for vSphere. For vCloud Director, Get-CIView will offer a similar type of interaction, opening up the entire vCloud API to enable tasks which are part of the vCloud API that do not yet have a specific cmdlet.

vCloud Director Cmdlet Overview

The following cmdlets are part of this release and can be retrieved with:

Get-PSSnapin –Module VMware.VimAutomation.Cloud

As always you can find out more information on these cmdlets using the Get-Help cmdlet within PowerCLI.

 

Name

Synopsis

Connect-CIServer

Connects to the specified servers.

Disconnect-CIServer

Disconnects from the specified cloud servers.

Get-Catalog

Retrieves the specified cloud catalogs.

Get-CIRole

Retrieves roles in the cloud.

Get-CIUser

Gets cloud users.

Get-CIVApp

Retrieves virtual appliances in the cloud.

Get-CIVAppTemplate

Retrieves virtual appliance templates.

Get-CIView

Returns cloud views by Id.

Get-CIVM

Retrieves the virtual machines on the cloud.

Get-ExternalNetwork

Retrieves cloud external networks.

Get-Media

Retrieves cloud medias.

Get-Org

Gets cloud organizations.

Get-OrgNetwork

Retrieves cloud organization networks.

Get-OrgVdc

Retrieves organization VDCs.

Get-ProviderVdc

Retrieves the specified cloud provider VDCs.

Import-CIVApp

Imports a virtual machine from vSphere to a cloud.

Import-CIVAppTemplate

Imports a virtual machine or an OVF package from a vSphere server to the vCloud as a virtual appliance template.

Search-Cloud

Searches the cloud for objects of the specified type.

 

Download

PowerCLI 5.01 can be downloaded from the PowerCLI download page here.

Stay tuned for more blogs explaining how to use these new cmdlets.


December 23, 2011

Community PowerCLI Scripts Week 51

As Christmas is approaching at the moment it reminds me of good will and helping others, something the PowerCLI community knows all about.  I constantly see people helping each other, writing scripts, sharing tips or just meeting up to talk about PowerShell and PowerCLI.  Sometimes scripts are even written by multiple people with the same end goal in mind “Helping the community”

The first of these scripts is such a script – multiple authors but first started by Josh Atwell, a great script for ensuring your VMs are ready for vMotion….

vTesseract.com Y U No vMotion ?

A great script which helps you diagnose vMotion issues, ensure your vMotions will take place by allowing PowerCLI to test each machine before it is moved.

JonathanMedd.Net - Configuring HP EVA Recommended Settings for ESXi via PowerCLI

Do you have a HP EVA Array ?  Make sure you check out this script which will automatically setup your hosts with the HP recommended settings.

Lucd.Info - vSphere 5 Top 10 – VMFS5

A set of nice scripts which will automate lots of great VMFS 5 items, if you just want to view the version of the datastore or maybe mass upgrade all datastores to VMFS5 then make sure you check out this great post.

blogs.vmware.comvCO PowerShell Plug-in

Not a script but a plug-in, this post shows how vCenter Orchestrator can be used to run PowerShell scripts from workflows, maybe you want to convert some of your scripts into workflows, maybe you want to use other PowerShell features and snapins inside your workflows – get it all here, well worth a read !

vniklas.djungeln.se Check number of running VMs on a datastore

Not a script but a one-liner, with this single one line of code you will be able to instantly see how many powered on VMs are on your datastores.


December 16, 2011

Community PowerCLI Scripts Week 50

Week on week I see some great scripts coming from the PowerCLI community, I thought it would be a great idea to share the top 5 scripts (in my opinion) and ensure PowerCLI users are aware of these great scripts.

Lucd.Info - vSphere 5 Top 10 – HA

A collection of great scripts which show how to detail information on vSphere 5 HA roles and configuration including heartbeat datastore information.

Blogs.technet.com - Use PowerShell to Simplify Access to Data Through PowerCLI

A guest script on the Microsoft Scripting Guys blog which shows some of the great features of PowerCLI and specifically more information on Get-View, ExtensionData and the New-VIProperty Cmdlet.

Lucd.Info - vSphere 5 Top 10 – Storage DRS

Another great script showing how to use PowerShell advanced functions to extend the PowerCLI cmdlets and add support for datastore clusters, some great functions here to Get, Set, create and remove datastore clusters.

blog.shonkyholdings.com - Using export-clixml to recreate vSphere (PoSH) objects

A nice script showing how to export objects as XML data and what benefits this will give you.

Virtu-Al.net – VM Start-up script

This script shows how to find certain VMs on your hosts and start them, this is a great script to use when you have lost your virtual vCenter and need to start it up quickly.


December 05, 2011

Podcast: What's new in PowerCLI 5.0

PowerScriptingIf you have a commute to work or just want to keep up to date with what’s going on in the world of PowerShell there is no better way than to listen to PowerShell based podcasts, there are two great podcasts available at this point in time which focus on PowerShell and often include great PowerCLI tips and interviews.

See the bottom of this post for a link to the downloads.

Recently on the PowerScripting podcast episode 166, Alan Renouf from VMware Technical Marketing gave an interview on what's cool in the PowerCLI world, he explained how he got started in PowerCLI and also some of the new features in PowerCLI 5.0.

I recommend downloading and listening to the PowerShell podcasts, they are a great source of information and sure to make the  time go quicker when you are stuck in endless traffic !

Download / Subscribe

 

PowerScripting Podcast

Get-Scripting Podcast

Website

http://powerscripting.wordpress.com/

http://get-scripting.blogspot.com/

RSS Feed

http://feeds.feedburner.com/PowerScripting

http://feeds.feedburner.com/Get-scripting

iTunes

http://itunes.apple.com/gb/podcast/powerscripting-podcast/id256074147

http://itunes.apple.com/podcast/get-scripting/id286899256

 

And of course if you have iTunes installed then you could always add the podcasts with PowerShell…

#PowerScripting

$iTunes = New-Object -ComObject iTunes.Application
$itunes.subscribetopodcast(http://feeds.feedburner.com/PowerScripting)

 

#Get-Scripting

$iTunes = New-Object -ComObject iTunes.Application
$itunes.subscribetopodcast(http://feeds.feedburner.com/Get-scripting)

 

 

Alan Renouf – Technical Marketing


November 22, 2011

vCloud Director PowerCLI Cmdlets

Would you like to win access to the fantastic PowerCLI Course by Trainsignal ?

Would you like to help shape the future of PowerCLI ?image

Read on….

As announced at VMworld 2011, we are currently in the process of extending the PowerCLI capabilities to automate vCloud Director (vCD) configuration, as part of this we would like to focus the users of PowerCLI and vCloud Director and allow you to have your say.

To do this we have put together 4 simple questions to get your feedback.

Please select the option that best fits your desired user experience for each of the questions.

To thank you for filling in this survey, we will select one of you at random to take the PowerCLI training course online on the TrainSignal website.

 **Optional. Please note that we will only use your email to contact the winner, no spam will be sent and no record of this address will be kept for future reference.**

Please fill in the 4 question survey here

Any questions around this area can be posted in this community link: http://communities.vmware.com/thread/337330?tstart=0


November 17, 2011

VM Tools and Virtual Hardware Versions

Alan Renouf, Sr Technical Marketing Architect, VMware

After reading Kyle’s post on the ESXi Chronicles blog here (I didn’t know you could do that) I wanted to show how you could gather and also export the Tools and Virtual Hardware Version in PowerCLI, this also allows us to use one of my favorite cmdlets New-VIProperty, a great post on this cmdlet can be found here.

If we look at the  object which gets returned back when we use the Get-VM cmdlet you will see that there is a root property for the Name, PowerState, NumCPU and many many more, one of these is the Version, this shows the hardware version so its easy enough to grab each VM’s name and Hardware Version by using:

Get-VM | Select Name, Version

But the returned object doesn’t have a root property for ToolsVersion or ToolsVersionStatus, for this we need to delve into the ExtensionData property and have a look around, once we have found the information it is fairly easy to add these to our object using the New-VIProperty cmdlet as below:

New-VIProperty -Name ToolsVersion -ObjectType VirtualMachine `
    -ValueFromExtensionProperty 'Config.tools.ToolsVersion' `
    -Force

New-VIProperty -Name ToolsVersionStatus -ObjectType VirtualMachine `
    -ValueFromExtensionProperty 'Guest.ToolsVersionStatus' `
    -Force

Now we have added these as a new property to our object (actually they are PowerShell Code Properties), we can use our old friend Get-VM to retrieve the information easily:

Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus

image

Of course we can choose which list of VMs to get this information for:

For a Datacenter: Get-Datacenter London | Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus

For a cluster: Get-Cluster Production | Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus

For a host: Get-VMHost Host1.mydomain.local | Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus

And we can also easily export this information into a csv file:

Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus | Export-Csv -NoTypeInformation -UseCulture -Path C:\Temp\VMHWandToolsInfo.csv


November 11, 2011

How do you use PowerCLI ?

How do you use PowerCLI ?

That was one of the questions I asked this year at both VMworld Las Vegas and also VMworld Copenhagen, there was some nice answers to this question, often people I meet are using PowerCLI in ways I never thought of, others don’t realize how powerful it actually is and how much time they can save.

This year at VMworld there was lots of great fun around PowerCLI, if you want to see how people use PowerCLI and see what the buzz was like at VMworld then please watch the below video.

If you have cool ways you are using PowerCLI make sure you add a comment to this post to tell everyone else !

 


November 07, 2011

vSphere Distributed Switch PowerCLI cmdlets

For a long time now when presenting at VMworld or user groups I have asked the question – What would you like to see from PowerCLI next ?  The standard answer I get at most of these is vSphere Distributed Switch (VDS) cmdlets !

Luc Dekens did a great job with his series of posts showing how you could create your own VDS advanced functions, these allow you to add the functions to your PowerCLI session and work with VDS, find them here and take a look, they are a great example of how you can expand PowerCLI to support areas not yet written.

So what's new ?

VMware have now released some PowerCLI cmdlets as a fling which work with VDS and allow you to do most of the common VDS tasks in your vSphere environment.  Please note that this is a fling and therefore not officially supported by VMware, having said that we are definitely keen for you to download these and try them out – please make sure you leave feedback as this will help with future versions !

Requirements

  • Windows required XP, Windows Vista or Windows 7, Windows Server 2003, 2008
  • VMware PowerCLI 4.1.1 or later is needed

Continue reading "vSphere Distributed Switch PowerCLI cmdlets"


About this Blog

This blog provides insight and highlights for VMware vSphere PowerCLI, the best tool for automating management and configuration of VMware vSphere.

Subscribe via RSS  

Recommended Reading

Pimp your PowerCLI

Twitter


Facebook

    VMware Blogs