Hi,
i have a problem attaching a dvPortGroup to my e1000 adapter (because of Linux in the VM)... I use:
deviceConfigSpecs.push(System.getModule("com.vmware.library.vc.vm.spec.config.device").createVirtualEthernetCardNetworkConfigSpecE1000(vmNetwork,""));
to create the adapter and vmNetwork is the dvPortGroup. But the machine has an e1000 and the PortGroup but if I look in the settings I see an empty network label 😞
Could anybody help?
Christian
Hello Christian, give this workflow a shot
The attached .package file contains a workflow that consists of two actions. The workflow takes 3 possible inputs (only 2 are required):
1) vm (VC:VirtualMachine)
2) nicNumber (number) [optional] if not specified, first nic is chosen
3) dvPortgroup (VC:DistributedVirtualPortgroup)
The result of running the workflow is the VM's NIC should be connected to the specified Distributed Virtual Portgroup :smileygrin:
Hi Christian,
can you "extract" your elegant single line to different lines, and instanciate every part explicitly with var myspe = new ....ConfigSpec().
I had some issues that the push to array only works well if the objects exists already (there is also a remark in the release notes about this, but in another context)...
Regards,
Joerg
BTW: Check the Onyx-for vCO, in the onyx-action you have to create (to use copy paste from the onyx output directly) it does exactly the same thing...
Hi Jörg,
my hope was that i didn´t have to write a complete deviceConfigSpec with the new backingInfo (like Onyx does)...
But it seems i have no choice... 😞
best regards
Christian
Hello Christian, give this workflow a shot
The attached .package file contains a workflow that consists of two actions. The workflow takes 3 possible inputs (only 2 are required):
1) vm (VC:VirtualMachine)
2) nicNumber (number) [optional] if not specified, first nic is chosen
3) dvPortgroup (VC:DistributedVirtualPortgroup)
The result of running the workflow is the VM's NIC should be connected to the specified Distributed Virtual Portgroup :smileygrin:
I found a way to avoid building the entire spec is to do this.
string existingNetwork = "xxxxx"
var devices = VM.config.hardware.device;
for( var i in devices){
if(devices[i] instanceof VcVirtualE1000 || devices[i] instanceof VcVirtualPCNet32 || devices[i] instanceof VcVirtualVmxnet) {
if (devices[i].deviceInfo.summary == existingNetwork)
Once you have the device you are looking for you can just change the backing spec to the appropriate dvportgroup
This way supports changing any network type avoiding the issues arising from the onyx methods.
mcfadyenj - be sure to review the action provided in my package - you're missing the code for vmxnet2 and 3 My goals when writing code for actions and workflows is to try to make them as usable as possible by many different people/orgs, so having the extra few checks for nics that could exist is quite worthwhile
I'm glad to see you picking up on the vCO stuff and generating conversations here!
Hi Burke,
works excellent! Thanks. After that i have shorten my ConfigSpec code like yours 🙂
Thanks again!
best regards
Christian