Tag Archives: PowerCLI

ESXCLI and killing a stuck VM

With the release of vSphere 5.0 there have been some changes to ESXCLI to bring the fragmented commands into more of a formal and discoverable structure as part of this ESXCLI has been expanded, as a reminder ESXCLI can be used from both vCLI and also in technical support mode, a high level of the new ESXCLI 5.0 name spaces as can be seen below:

image

Kill a VM with ESXCLI

As you can see from above, the structure has clearly changed from VSphere 4.1, lets take a look at an example, if we wanted to kill a stuck VM which has been documented as part of KB Article 1004340 which can be found here.

We can do this by using the following ESXCLI 5.0 example:

Continue reading →

VMware Management with PowerCLI 5.0

As VMware expands its PowerShell offering, known as PowerCLI, the poster has been a key resource for keeping the details close to hand and ensuring the help is right in front of you when you need it.

An updated poster was released at VMworld and adds to the original vSphere PowerCLI core cmdlets enabling people to reference all PowerCLI related details in one handy place.

It includes the details from the following:

  • vSphere
  • Image Builder
  • Auto Deploy
  • Update Manager
  • Licensing
  • View
  • vCloud

Make sure you download the PDF copy of the poster from here. Continue reading →

Check vCenter Services

A quick function which allows you to check the VMware services on your vCenter server by hooking into windows and looking at the service status, this is useful and something I have been using as part of my vCheck script for a long time but recently became useful for a colleague.

The script can be run with no credential parameter if the current user account has windows privileges on the vCenter server to read the service information.

Example

SNAGHTML14bff311
Continue reading →

vSphere 5 License Entitlement changes

Following my previous post VMware have just announced a change to the License entitlements to vSphere 5, I know I work for VMware and therefore my view is obviously slightly tainted but I personally think this is a good move and it proves that they do listen and value their customers opinions.

So what changes have been made ?

  1. VMware have increased vRAM entitlements for all vSphere editions.
  2. The amount of vRAM has been capped at 96GB of vRAM, so if your VMs have over this amount it will only count the first 96GB.
  3. The amount of vRAM is now calculated as a 12 month average of allocated vRAM

New Entitlements

The changes mean that the following vRAM entitlements per edition will now be granted:

vSphere edition vRAM entitlement
vSphere Enterprise Plus 96 GB
vSphere Enterprise 64 GB
vSphere Standard 32 GB
vSphere Essentials Plus 32 GB
vSphere Essentials 32 GB
Free vSphere Hypervisor 32 GB (Per Host)

Continue reading →

Update and re-composure of View Pools

I was recently asked if it was possible to automate the update of a View Pool every week after the updates had been applied to the virtual machines using Windows Update services, the process is quite straight forward.

This person needed to snapshot  a VM after the updates were completed and then use this snapshot to re-compose the pool, after this was complete they would then use this pool to make sure there were no issues.

The following script does just that, it takes the VM from a given pool and snapshots the VM, it then adds this snapshot back as the active replica for the pool, the idea is to run this as a scheduled task (maybe on Tuesday night) on the View server allowing the snapshot to be created every time it runs.

Watch it in action…

Continue reading →

vSphere 5 License Entitlements

A somewhat surprising popular topic at the moment considering the amazing features announced by VMware this week is vSphere 5 Licensing, I have seen a lot of people talking about this and a lot of confusion and misunderstanding of the new licensing model announced by VMware in vSphere 5. Hopefully this post and my script below will help people work out what their v5 License entitlements will be.

vSphere 5 License Overview

vSphere 5.0 will be licensed on a per-processor basis with a vRAM entitlement. Each vSphere 5.0 CPU license (whether deployed to a host or not) will entitle the purchaser to a specific amount of vRAM, or memory configured to virtual machines. The vRAM entitlement can be pooled across a vSphere environment and through linked mode vCenters to enable a true cloud or utility based IT consumption model.

vSphere Advanced is now being removed from the license editions, anyone who currently has licenses for vSphere Advanced – and is active on Subscription and Support – in v4 will automatically be entitled to Enterprise in v5 free of charge, the following vRAM entitlements will be given per license type:

License Type Essentials Essentials Plus Standard Enterprise Enterprise Plus
vRAM Entitlement per license 24GB 24GB 24GB 32GB 48GB

There are a few key things to remember about this:

  • vRAM is pooled per license type to create a pool
  • Make sure all license keys you have purchased are entered into vCenter
  • All Licenses (whether deployed or not) add Pooled vRAM capacity
  • Make sure existing vCenter servers are linked – vRAM licenses are pooled across linked mode vCenters giving a total vRAM per license type.

More information on these changes can be found in the Licensing, Pricing and Packaging white paper here.

Continue reading →

Which VMs set your Slot Size ?

A previous post on my blog shows us how to get the slot size information for each cluster which has HA enabled, it also discusses what a slot size is and points to some further reading on Yellow-Bricks.

Readers of the great HA and DRS book will know exactly what a slot size is, if you are unsure then I suggest you read my previous article or the HA and DRS book, it is important information to know.

But which VMs are setting your slot size ?  This is a question which was emailed to me over a year ago, someone had issues finding the VMs which were setting their slot size and they had run out – not a good place to be.

I wrote a script for them and asked them to test it, then I completely forgot about it – until recently when the question came up again.

Now you probably think you know which VM’s are setting your slot size but the thing that struck me is that nearly all the people I asked to check this came back with the same comments:

Yep, it works and wow, I had forgotten about that machine and the resources I allocated to it !

So please, download it and give it a go, who knows you too may have a surprise.

 

Continue reading →

Number of Physical & Virtual CPU’s per host & Cluster

Recently I received a comment on an older post of mine which gave output of the number of virtual CPU’s on a host and also in a cluster, the comment asked if there was a way to export this to a text or html file which is easy enough in PowerShell.

After reading my code I was astounded at how bad it was, one thing i wish I had time for was to go back to some of my earlier code to tidy it up with the tips and tricks I have learnt over the last year and also amend it to use the new features provided to us by the PowerCLI team to make things easier.

One such feature is a cmdlet in the current release of PowerCLI (4.1 U1) (If your not sure what version you are running then just type Get-PowerCLIVersion at the prompt). 

The cmdlet I am referring to is New-VIProperty, this cmdlet allows us to add additional properties to the returned values from certain objects, for a detailed post on this cmdlet look at Luc’s great post here I can also highly recommend his list of New-VIProperty examples which is amazing and can be found here.

Basically this allows us to expand our returned objects from cmdlets to give us further information for an easy example if we run Get-VM we will receive a number of different default properties but what if we wanted something that wasn’t on the list of returned properties ?  Normally we would need to use a PowerShell expression to add this data when we select the data: Continue reading →

Using the View PowerCLI cmdlets from another machine

As of version 4.6 VMware View came with some PowerCLI Cmdlets, I wrote a post about these recently after they were released explaining why this was both a good and a bad thing.

I have seen a couple of posts since then using View PowerCLI :

Myself, I never really had a reason to use them that much, I have been busy since they came out and have always been meaning to have a more thorough look at what could be done.

My next post will go into some more detail on the use case but for now I wanted to talk about using these cmdlets from another machine.  Normally with PowerCLI we can connect to the vCenter server using any machine with PowerCLI installed on it whether that be our workstation, an admin server or the vCenter server itself, unfortunately we are unable to do that with the View cmdlets as they stand but PowerShell can help us with this.

One of the features built into Windows PowerShell V2 is called remoting, to find out more information about this feature use the get-help cmdlet in PowerShell as follows: Get-Help About_Remoting.

Continue reading →