Skip to content

Instantly share code, notes, and snippets.

@adampats
Created August 4, 2015 17:08
Show Gist options
  • Select an option

  • Save adampats/b7a1efc15c4035d6e4a9 to your computer and use it in GitHub Desktop.

Select an option

Save adampats/b7a1efc15c4035d6e4a9 to your computer and use it in GitHub Desktop.
RbVmomi VirtualMachineConfigSpec
spec = {
deviceChange: [
{
operation: :edit,
device: RbVmomi::VIM::VirtualCdrom(
key: 2,
controllerKey: 200,
backing: RbVmomi::VIM::VirtualCdromAtapiBackingInfo(
deviceName: ""
),
connectable: RbVmomi::VIM::VirtualDeviceConnectInfo(
startConnected: false,
connected: false,
allowGuestControl: true))
}
]
}
task = vm.ReconfigVM_Task(spec: spec)
#####
[103] pry(main)> task.info
=> TaskInfo(
cancelable: false,
cancelled: false,
completeTime: 2015-08-04 17:04:33 UTC,
descriptionId: "VirtualMachine.reconfigure",
dynamicProperty: [],
entity: VirtualMachine("vm-4753"),
entityName: "rhel7base_v2015.08.04_SSC (for automated template creation)",
error: LocalizedMethodFault(
fault: InvalidDeviceSpec( deviceIndex: 0, faultMessage: [], property: "virtualDeviceSpec.operation" ),
localizedMessage: "Invalid configuration for device '0'."
),
eventChainId: 9015909,
key: "task-74458",
locked: [],
name: "ReconfigVM_Task",
queueTime: 2015-08-04 17:04:33 UTC,
reason: TaskReasonUser( dynamicProperty: [], userName: "svcaccount" ),
startTime: 2015-08-04 17:04:33 UTC,
state: "error",
task: Task("task-74458")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment