-
-
Save hartsock/e8c6c04adc64d0cbc343 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the updated device spec | |
VirtualDeviceConfigSpec nicSpec = new VirtualDeviceConfigSpec() | |
nicSpec.device = nic | |
nicSpec.operation = VirtualDeviceConfigSpecOperation.edit | |
// Create the VM update spec | |
VirtualMachineConfigSpec spec = new VirtualMachineConfigSpec() | |
spec.deviceChange = [nicSpec] | |
// Do the update | |
try { | |
Task task = virtualMachine.reconfigVM_Task(spec) | |
// Wait for it to complete | |
task.waitForMe() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment