After upgrading many VMs to the latest hardware version, a few of our VMs experienced an issue where 3D was enabled and auto-detect was set to manual. Some adverse effects were experienced. I am now looking to create a workflow to disable 3D and set auto-detect for our servers. I found the properties "enable3DSupport" and "useAutoDetect" under VirtualDeviceConfigSpec.VirtualDevice.VirtualMachineVideoCard.
I planned to script this into an action and create a workflow to pass it a VM that a user selects.
I fired up Onyx and pulled the following info:
// ------- ReconfigVM_Task -------
var spec = new VcVirtualMachineConfigSpec();
spec.changeVersion = "2013-02-21T16:34:32.130873Z";
spec.deviceChange = System.getModule("com.vmware.onyx").array(VcVirtualDeviceConfigSpec, 1);
spec.deviceChange[0] = new VcVirtualDeviceConfigSpec();
spec.deviceChange[0].operation = VcVirtualDeviceConfigSpecOperation.edit;
spec.deviceChange[0].device = new VcVirtualMachineVideoCard();
spec.deviceChange[0].device.key = 500;
spec.deviceChange[0].device.deviceInfo = new VcDescription();
spec.deviceChange[0].device.deviceInfo.label = "Video card ";
spec.deviceChange[0].device.deviceInfo.summary = "Video card";
spec.deviceChange[0].device.controllerKey = 100;
spec.deviceChange[0].device.unitNumber = 0;
spec.deviceChange[0].device.videoRamSizeInKB = 8192;
spec.deviceChange[0].device.numDisplays = 1;
spec.deviceChange[0].device.useAutoDetect = true;
spec.deviceChange[0].device.enable3DSupport = false;
managedObject.reconfigVM_Task(spec); // VirtualMachine
I know most of that is not needed but I tried a couple different ways and received the following error:
Cannot convert com.vmware.vim.vi4.VirtualDeviceConfigSpec@1 to com.vmware.vim.vi4.VirtualDeviceConfigSpec[] (Dynamic Script Module name : changeVideoCard3DEnable#9)
Can anyone provide some guidance? It seems like most of the actions and workflows in vCO are geared towards getting information in the environment rather than changing items.
Thanks,
-Zach