VMware Cloud Community
filjo2409
Enthusiast
Enthusiast
Jump to solution

Enable guest customization option with PowerCLI in vCloud

Hi,

I was wondering if there is a way to enable guest customization with PowerCLI instead of vCloud web GUI.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Can you try with

$vm = Get-CIVM -Name 'MyVM'
$gc = $vm.ExtensionData.Section | Where { $_.Type -eq 'application/vnd.vmware.vcloud.guestCustomizationSection+xml' }
$gc.Enabled = $true
$gc.UpdateServerData()


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Can you try with

$vm = Get-CIVM -Name 'MyVM'
$gc = $vm.ExtensionData.Section | Where { $_.Type -eq 'application/vnd.vmware.vcloud.guestCustomizationSection+xml' }
$gc.Enabled = $true
$gc.UpdateServerData()


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

0 Kudos
filjo2409
Enthusiast
Enthusiast
Jump to solution

Yep that's the correct answer! Thanks LucD!

 

In the meantime I've found another way to do it through vCloud's API:

  1. Go to your vCloud web Gui
  2. Go to your VM from vApp you want to enable the guestCustomization
  3. Click on “Edit”
  4. Right click anywhere on the page and click “Inspect” and navigate to “Network section”
  5. Now click “Enable guest customization” option to enable it and click "Save"
  6. Catch the query from Network section
  7. From the network section you can copy the api URL, token and payload
  8. Now within the payload section you can find “<root:Enabled>true</root:Enabled>” part. Here you can change the value to “true” or “false” and use the body, URL and token to toggle the option from an PowerCLI script

 

But yeah, your answer is much better.

0 Kudos