VMware Cloud Community
tcross
Contributor
Contributor

Modify VM hardware with vCloud Director and PowerCLI

After deploying a new VM in vCloud Director (with New-CIVM via PowerCLI), what PowerCLI cmdlets are available to then modify the number of CPUs and RAM for a given deployed VM?  I can't find any documentation on this at all.  Some say to modify the ExtensionData but that appears to just be reporting the current state instead of allowing to update it.

Doesn't seem to work:

for($i = 0; $i -le $VM.ExtensionData.Section[0].Item.Length; $i++) {

  if($VM.ExtensionData.Section[0].Item[$i].Description.Value -eq "Memory Size") {

     $VM.ExtensionData.Section[0].Item[$i].VirtualQuantity.Value = $line.RAM

  } elseif ($VM.ExtensionData.Section[0].Item[$i].Description.Value -eq "Number of Virtual CPUs") {

     $VM.ExtensionData.Section[0].Item[$i].VirtualQuantity.Value = $line.CPU

  }

}

Tags (3)
0 Kudos
3 Replies
LucD
Leadership
Leadership

You need to make a call to UpdateServerData.
See set vCloud Director vApp VM memory and hardware with PowerCLI

Afaik there isn't any 'official' documentation available on this.
Although the method is shown and used in many code examples, blog posts and also in our PowerCLI Reference there isn't any official documentation on that method afaik.

Perhaps something to submit as a PowerCLI Idea?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
tcross
Contributor
Contributor

I heard in past vCD releases that modifying VMs directly in vCenter presented issues in vCD.  Yet in vCD v9.5 or later, this may no longer be an issue?  Thinking it may just be easier to modify hardware directly in vCenter?

0 Kudos
LucD
Leadership
Leadership

I'm afraid I don't know that.

That might be something to ask in the VMware vCloud Director community.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos