Search This Blog

Thursday, September 4, 2014

Unique IDs for VMware virtual machines and ESXi Hosts

Virtual machines - UUID or InstanceUUID 

Historically, Unique ID's or serial numbers have been a challenge within VMware. The lack of Uniqueness limited the number of objects vCenter could manage and the inability to uniquely identify Virtual Machine utilization for asset control.

In the early days of version 3 Virtual Center, VMware virtual machines were unique identified by a managed object reference ID (called a MoREF). MoREF's were were limited to 99 instances and duplicates easily occured. vCenter 4.* came along and several changes were introduced. The Virtual Machine object history of unique identification was as follows

  • Virtual Center 3 
    MoREF's were expanded to 999, but that didn't sufficiently reduce duplicates or allow for more than 999 vm's per vCenter.
  • Virtual Center 4. * 
    UuID was introduced. When a VM is created, ESXi creates the 128-bit integer Uuid such as: 421b4187-bcb4-3dc1-e7d7-c9496d3fdca9 The UUID was how vCenter 4.* tracked a Virtual Machines. This failed however, because duplicates occur during VM copy or cloning.
  • vCenter 4.1 (if I recall correctly) 
    the PersistentID was introduced as a more Persistent identifier.
  • vCenter 5.* - PersistentID was changed to InstanceUuidTherefore, the InstanceUuID is, as of vCenter and ESXi version 5.0, 5.1, and 5.5 is unique. Duplicates for UUID and MOREF may still occur due to replication, copy, or cloning processes.

 

The InstanceUuid, formerly known as PersistentID before it was deprecated, is best known method for unique identification of a virtual machine within a vCenter or a collection of vCenters.

The InstanceUuid is not visible through the vCenter Client, but it is visible through the vCenter API (SDK) or through PowerCLI.

Example 

If connected to a vCenter or ESXi host through PowerCLI, here's a code snippet to view both the UuID and the PersistentID:

PowerCLI InstanceUuid Access Method
PowerCLI C:\> get-vm VirtualMachineName | get-view | % { $_.config } | Format-Table -a *uuid
 
 
Uuid                                 InstanceUuid
----                                 ------------
421b4187-bcb4-3dc1-e7d7-c9496d3fdcb9 501b3ae4-16b3-2d7a-4492-553852f45e62

VM Example 2 - Virtual Machine List

This HTML LINK shows Virtual Machines with their InstanceUuid. The reports converts InstanceUuID to PersistentID for the support of legacy nomenclature:
Click column heading to SORT. 

NamePersistentID TypeState
abbott5027322a-5e15-5a98-4c59-2927e9f9611c VMpoweredOn
acmeascpoc015027ded7-b8fa-8c39-f279-a258fb183992 VMpoweredOn

  

ESXi Physical Servers

VMware's ability to obtain Serial Numbers from Physical Servers is a bit more challenging because server hardware vendors expose those attributes differently.

The object hierarchy is as follows:

$VMhost.Summary.Hardware.OtherIdentifyingInfo.IdentifierType.Key["ServiceTag"].IdentifierValue 

From a vCenter API perspective, the Powershell PowerCLI method is as follows, a simple method is as follows:

PowerCLI VMhost Serial Number
$VMhost = Get-VMhost HostName | Get-View
 
$VMhost.Summary.Hardware.OtherIdentifyingInfowhere {$_.IdentifierType.Key -eq "ServiceTag" } | % { $_.IdentifierValue }
 
[Output Values:]
FOX1605G9YF
FCH17307L8U
 

 

An code Example to get the data formatted in a nicer format follows:

Example - PowerCLI Example to get VMhost and Serial Number

PowerCLI Example to get VMhost and Serial Number
PowerCLI C:\> Get-VMhost  LabServer01 | Get-View select name, @{N="Serial" ; E= { $_.Summar
y.Hardware.OtherIdentifyingInfowhere {$_.IdentifierType.Key -eq "ServiceTag" } | % { $_.IdentifierValu
e }  } }
 
Name           Serial
----           ------
LabServer01   {FOX1605G9YF, FCH17307L8U}

 

As shown in the example above, the code returns 2 values. This occurs because the hardware vendor, Cisco, presents serial numbers per Processor.

Tuesday, September 2, 2014

ALERT - BOB A. Is a secret fan of Mark Knopfler

An anonymous source stated today that Bob Apo. is a longtime fan of Mark Knopfler. Mr. Knopfler is best known for leading astray tens of millions of youth who grew up in the 70's and 80's. 

  https://duckduckgo.com/?q="mark+knopfler"


Wednesday, July 16, 2014

Difference between Web Client and Fat Client (and PowerCLI 'client') - vSphere 5.5

Note that VMware vSphere 5.5 VM's can be managed with VMware Workstation 10 and higher.

This article is an attempt to maintain a comparison between vCenter Web Client and the vCenter .net Client (aka, Fat Client).


Feature

.Net Client
(Fat Client)

Web Client

PowerCLI

VMotion VM between Datastore AND Host at the same time

No

yes

yes

VMotion between Hosts

Yes

Yes

Yes

Vmotion Between Clusters

No

Yes

Yes

VMotion Between Datacenter

No

Yes

Yes

VMotion Between vCenters (requires Linked Mode)

No

Yes

Yes

Schedule vHardware Upgrade

No

Yes

Yes

Edit VM's with VMX-10 vHardware
Supported Versions[vi]: http://kb.vmware.com/kb/2007240

No

Yes

Yes

Hot Add vCpu & vMem to VM While Power On -- Windows 2008 and lower

Yes

Yes

Yes

For Windows 2012r2

No

Yes

Yes

vCenter UpdateManager Scan

Yes

Yes

Yes

vCenter UpdateManager Patch

No

Yes

Yes

Alerts - Acknowledge and Clear

Yes

Yes

Not Native

Host Profile Creation

Yes

Yes

Yes

Host Profile Editing

Limited

Yes

Limited

 

 

 

 

 

Vmware has pretty much screwed up Host Profiles. It worked great in 4.0. Got worse with 5.0/5.1. It's no better in 5.5. The mitigating aspect of HostProfiles is that you can script away with PowerCLI most of the HostProfile frailties. That said, why use HostProfiles at all if you can standardize a VMhost configuration with scripts?



Improve and Increase VMotion Performance

1           Improve VMotion Performance

Configuring Multi-NIC vmotion in vSphere 5.5 provides much improved performance for VMOTION by creating a vmotion vmkernel for each NIC on a vswitch.  Muli-NIC vmotion began support since vSphere 5.0.  

1)      Select t vSwitch for Vmotion that contains 2 or more VMNIC utilized for vmotion.

2)      Create a VMkernel vmotion portgroup and give it the name "vmotion01″ and assign IP address on the supported VLAN.

3)      Repeat, and create a second VMkernel Interface and give it the name "vmotion02″.
The vSwitch should appear with 2 vmkernel Portgroups as follows:

Figure 8 VMotion Multiple Portgroups

4)      Per Figure 9, edit the vmotion01 NIC Teaming  tab assigning vmnic1 NIC-port as active and all others as "standby."

5)      Go to the settings of vmotion02 and configure a different NIC-port as active and all others as "standby."

vmotion01 vmnic configuration


vmotion02 vmnic configuration


 

Reference: Multi-NIC VMotion configuration: http://kb.vmware.com/kb/2007467

Tuesday, December 3, 2013

Samsung Galaxy S4 Review (Verizon)

I recently obtained a Samsung Galaxy S4 on Verizon. Here's my ongoing review:

Pros
  • Large Screen
  • Bright Screen
  • Long Battery Life, even while using intense apps
  • OS root hack available allowing disabling/removal of junkware from Verizon and Samsung. This voids your warranty if discovered.
  • Stays COOL (my Samsung Galaxy S2 would get super hot and battery longevity was poor).

Cons:
  • Slow interface
    • Window Animation is Slow
    • Touch response is slow often resulting in double-touch errors
  • Samsung (or Verizon) hid the DEVELOPER interface
  • BLOATED with Verizon junkware apps (Same for Sprint)
  • BLOATED with Samsung features that are too complicated to use (such as Allshare)
  • BLOATED with Samsung junkware applications
  • Full Root not available :(  however, system root is available.

The fact that Verizon locks these phones and stuffs them with Verizon junk and tracking software suggests to me that their intention is to 100% control your experience. What if I don't want to use the phone the way Samsung or Verizon wants? It's a long standing gripe, 

Monday, April 8, 2013

Lightning Fast One-liner to get a list of all VM's with Snapshots

There are others, but I think this method rules. I'll first list the entire one-liner then break it down by color code:

Get-View -ViewType VIrtualMachine -Property Name , SnapShot, LayoutEx -Filter @{"Snapshot.CurrentSnapshot" = "snapshot"  } | ? { $_.name -match "$VM" } |
Select @{"N"="VM" ;  E={$_.Name}},
@{N= "vCenter"      ; E=  { $_.Client.ServiceUrl.Split("/")[2].split(":")[0]  }},
@{N= "Snapshots"    ; E = { (($_.LayoutEx.Snapshot | % { $_.Key }) | measure).count  }  },
@{N= "SnapsSizeGB"  ; E = { (($_.LayoutEx.File | ? { $_.Type -match "snapshotdata" } | measure -Property size -Sum ).sum *3 / 1gb ).ToString("#,0.00")   }  } ,
@{N= "OldestSnapshot"  ; E = { $_.Snapshot.RootSnapshotList | sort createtime | select -F 1  createtime | % { $_.CreateTime } } },
@{N= "DaysOld"  ; E = { $_.Snapshot.RootSnapshotList | sort createtime | select -F 1  createtime | % { ((Get-Date) - $_.CreateTime ).Days } } } | sort -desc DaysOLD

The first statement:

Get-View -ViewType VIrtualMachine -Property Name , SnapShot, LayoutEx -Filter @{"Snapshot.CurrentSnapshot" = "snapshot"  }

The above line will simply return all VM's with Snapshots. It's that simple, and it's very fast. Next the results are piped to a Where filter.

Notice the "$VM" variable? Use it to filter your script by VM names, and remember this that field is a regular expression, so you can't use the typical  wild card (* or ?) characters.  Normally, the -Filter array would contain "Name"="$VM", but doing that here would present an "OR" filter statement which would return wrong results. So we filter on found items in Get-View.

? { $_.name -match "$VM" } 

The final statement is a Select statement massages the results into these kind of results:

VM
vCenter
Snapshots
SnapsSizeGB
OldestSnapshot
DaysOld
Windows2003r2_Std_Tpl vc2wrvc06.int.loc 2
0.00
20/28/2022 2:56:22 PM 527
2622PPPHMR3 vc2wrvc03.int.loc 2 22.00 6/22/2022 3:59:26 PM 290
2622PPPH2 vc2wrvc03.int.loc 2 72.00 7/28/2022 7:33:36 PM 263
2650ppph2 vc2wrvc03.int.loc 2 72.00 7/28/2022 7:35:02 PM 263
2572ppph2 vc2wrvc02.int.loc 2 72.00 7/28/2022 7:32:25 PM 263
ar2550ppph2 vc2wrvc02.int.loc 2 72.00 7/28/2022 2:32:40 PM 263
2568xptest2 vc2wrvc04.int.loc 2 6.05 2/6/2023 20:38:56 PM 60
2568XPTEST3 vc2wrvc04.int.loc 2 24.20 2/23/2023 5:24:22 PM 53
2568XPTEST4 vc2wrvc04.int.loc 2 22.05 2/23/2023 5:24:06 PM 53
0223CTXWEB02 vc2wrvc03.int.loc 2 22.05 2/28/2023 20:55:03 PM 48
0223CTXWEB02 vc2wrvc03.int.loc 3 36.25 2/20/2023 9:53:43 PM 46
0223CTXSQL02 vc2wrvc03.int.loc 2 22.05 2/22/2023 9:56:39 PM 44
2568CTXWEB04 vc2wrvc04.int.loc 2 0.00 2/26/2023 7:56:02 PM 40
2706AMRSCN21 vc2wrvc04.int.loc 2 9.05 3/26/2023 7:00:54 PM 22
2568AMRDBE02 vc2wrvc04.int.loc 0 0.00 4/4/2023 22:08:25 AM 4

One problem I find is the snapshot size.  The Get-View VirtualMachine  object returns LayoutEx.File objects, but these objects do not report the same size disk as the Get-Snapshot returns. 

However, when I visually inspect the actual snapshot disk on the VMFS volume, I find that LayoutEx.File size is accurate and the Get-Snapshot is incorrect.  If I'm missing something, let me know.