Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 249166

Re: Change VM's video card settings

$
0
0

Christian,

 

I took your script and put it into a new action and tested it. It completed but within vCenter, it gave me an error saying it was an invalid configuration for device '0'. A co-worker and I began talking and I had mentioned that within Onyx it spat out a whole array of info when all I had changed was a single value. He said that it probably needs all of that information from the array to successfully apply the one setting I need to change. I then took your script and added the rest of the values that were in the array and kicked off the workflow. It completed within vCO and within vCenter with success! I've listed what I've entered into the action below:

 

 

var spec = new VcVirtualMachineConfigSpec();
var myDeviceChange = new Array();
var myVirtualMachineVideoCard = new VcVirtualMachineVideoCard();
var configSpec = new VcVirtualDeviceConfigSpec(); 
myVirtualMachineVideoCard.key = 500;
myVirtualMachineVideoCard.deviceInfo = new VcDescription();
myVirtualMachineVideoCard.deviceInfo.label = "Video card";
myVirtualMachineVideoCard.deviceInfo.summary = "Video card";
myVirtualMachineVideoCard.controllerKey = 100;
myVirtualMachineVideoCard.unitNumber = 0;
myVirtualMachineVideoCard.videoRamSizeInKB = 8192;
myVirtualMachineVideoCard.numDisplays = 1;
myVirtualMachineVideoCard.useAutoDetect = true;
myVirtualMachineVideoCard.enable3DSupport = false; 
configSpec.operation = VcVirtualDeviceConfigSpecOperation.edit;
configSpec.device = myVirtualMachineVideoCard; 
myDeviceChange.push(configSpec);
spec.deviceChange = myDeviceChange; 
vm.reconfigVM_Task(spec); 

Viewing all articles
Browse latest Browse all 249166

Trending Articles