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
}
}
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
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?
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