Friday, April 29, 2011

Vmware PowerCLI script for Licensing

Do you think using the Licensing tab for checking what features are licensed on each host kind of frustrating?

Welcome aboard!!!

I created a powerCLI script which will dump ESX 3.5 Licensing usage into a csv file, so you can import into Excel and play with it.

Here it’s:

$path = ".\ResultESX.txt"

$ESXHosts = Get-VMHost |Get-View

$ServiceInstance = Get-View ServiceInstance
$LicenseMan = Get-View $ServiceInstance.Content.LicenseManager
$Query = $LicenseMan.QueryLicenseUsage
foreach ($ESXHost in $ESXHosts)
{
$LicUse = $LicenseMan.QueryLicenseUsage($ESXHost.MoRef)
Write-Host -ForegroundColor Yellow $ESXHost.Name
Write-Host "License Server: $($LicUse.Source.LicenseServer)"
$resultWrite = $ESXHost.Name + ";" + "License Server: $($LicUse.Source.LicenseServer);"
foreach ($Reservation in ($LicUse.ReservationInfo |Sort Key))
{
If ($Reservation.State-eq "licensed")
{
switch ($Reservation.key)
{
"esxFull" {$FriendlyName = "ESX Server Standard"; break}
"esxExpress" {$FriendlyName = "ESX Server Foundation"; break}
"backup" {$FriendlyName = "VMware Consolidated Backup Usage"; break}
"vmotion" {$FriendlyName = "VMotion"; break}
"drs" {$FriendlyName = "VMware DRS"; break}
"das" {$FriendlyName = "VMware HA"; break}
"esxHost" {$FriendlyName = "VirtualCenter Agent for ESX Server"; break}
"nas" {$FriendlyName = "NAS Usage"; break}
"iscsi" {$FriendlyName = "ISCSI Usage"; break}
"san" {$FriendlyName = "SAN Usage"; break}
"vsmp" {$FriendlyName = "Up to 4-way SMP"; break}
default {$Friendlyname = "Feature not yet in script";break}
}
$resultWrite = $resultWrite + ";$FriendlyName licensed for $($Reservation.Required) Processors"
}
}
Add-Content $path $resultWrite
}

If you have no idea how to start, take a look at PowerCLI Basics

Thursday, April 14, 2011

Pegasus service failing

Recently I figured out that one of my ESX hosts were taking a long time to reboot.
Watching the POST I realized it was taking a long time trying to start Pegasus service, after a few minutes it fails and the remaining services start as usual.

It made me wondering why it was failing.

Pegasus is an open implementation of CIM, which monitors the hardware healthy and presents this information on the “Hardware Healthy” tab inside Virtual Center.
Learn more about Pegasus...

VMware has first identified this issue on KB1004257, but it specifies as an issue for ESX 3.5 update 1 and fixed with update 2. But my server is at update 5 !!!!

I found an article on Yellow Bricks blog about how to solve it. Take a look. (I did not use it to solve my issue)

What did I do to solve my issue ?

When looking at /var/pegasus/vmware/install_queue I found a few folders and files in there.
Those are the list of new MOF files waiting to be compiled; I can just guess why they are sitting in there. May be the first MOF file fails and the remaining ones does not get processed.
So, at every new patch/update I applied, the new MOF files are not getting compiled and queue get’s increasing.

To get all the files compiled I ran.

/etc/init.d/pegasus restart (sometimes I needed to run it twice.)

After each file got compiled, the pegasus service was back starting fine and fast.

I think you should take a look at the content of your folders (/var/pegasus/vmware/install_queue), right ; )

Thursday, April 7, 2011

Vmware View for iPad


Last post
we talked about the new Vmware vSphere client for iPad, but Vmware still developing tools to iPad, this time Vmware View is the tool.
Is not that exciting ?!?

I can see all new technology converting into a single solution, virtualization, VDI solutions where your desktop is virtual and why not on the cloud, now we don’t need to have a “regular’ pc to access it. You can do it with your iPad.

You can just go to iTunes and download it FOR FREE. Oh man , I love free stuff ; )

Here you can find all the details about it.

Who am I

My photo
I’m and IT specialist with over 15 years of experience, working from IT infraestructure to management products, troubleshooting and project management skills from medium to large environments. Nowadays I'm working for VMware as a Senior Consultant, helping customers to embrace the Cloud Era and make them succefully on this journay. Despite the fact I'm a VMware employee these postings reflect my own opnion and do not represents VMware's position, strategies or opinios.

Most Viewed Posts

Blog Archive