When using the static IP service in vCAC 5.2 you might come to a suprise after you installed vCAC 5.2 Hotfix 4 (HF4), because – it no longer works… VMware Support is informed about this and will fix it in HF5. Until then you either do not use this feature any more or use a workaround to “manually” assign the IP address via script:

PS > $m.GetType().FullName;
DynamicOps.ManagementModel.ManagementModelEntities
PS > $Machine.GetType().FullName;
DynamicOps.ManagementModel.VirtualMachine
PS > $StaticIPv4NetworkProfileName.GetType().FullName;
System.String
PS > $StaticIPv4NetworkProfile = $m.StaticIPv4NetworkProfiles 
  |? StaticIPv4NetworkProfileName -eq $StaticIPv4NetworkProfileName;
PS > if(!$StaticIPv4NetworkProfile) { 
  throw("Network profile '{0}' does not exist." -f $StaticIPv4NetworkProfileName); }
PS > $null = $m.LoadProperty($StaticIPv4NetworkProfile, 
  'StaticIPv4Addresses');
PS > foreach($ip in $StaticIPv4NetworkProfile.StaticIPv4Addresses) { 
  $null = $m.LoadProperty($ip, 'VirtualMachine'); 
  if($ip.VirtualMachine) { continue; }
  $m.SetLink($ip, 'VirtualMachine', $Machine);
  $m.UpdateObject($ip);
  $null = $m.SaveChanges();
  break;
} # foreach
# cleanup: detach unused entities and links

If you want this solution to be a little bit modular you can certainly only enumerate the network profiles that belong to the current reservation.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.