Quantcast
Channel: VMware Communities : Discussion List - VMware {code}
Viewing all articles
Browse latest Browse all 2738

Incompatible device backing error when editing network adapter

$
0
0

Hello Expert Developer,


I am working on an automatic VM deployment project for vSphere. I am trying to reconfigure deployed VM and change the MAC address of its network adapter. Device type which is being edited is Vmxnet3. I am using the following code snippet to reconfigure the VM in php using VMWarephp library.


[code]

    $deviceConfigSpec = new VirtualDeviceConfigSpec();

    $deviceConfigSpec->operation = 'edit';

    $deviceConfigSpec->device = new VirtualVmxnet3();

 

    foreach ($configInfo->hardware->device as $device) {

      if (get_class($device) == 'VirtualVmxnet3') {

          $deviceConfigSpec->device->key = $device->key;

          $deviceConfigSpec->device->controllerKey = $device->controllerKey;

          $deviceConfigSpec->device->unitNumber = $device->unitNumber;;

          $deviceConfigSpec->device->addressType = 'Manual';

          $deviceConfigSpec->device->macAddress = $mac;

      }

    }

 

    $configSpec = array('deviceChange' => array($deviceConfigSpec));

    $vm->ReconfigVM_Task(array('_this'=>$vm->reference, 'spec'=>$co

[/code]

 

When this code is ran, I get the following error in vSphere Client's task list:

 

[code]

   Incompatible device backing specified for device '0'

[/code]

 

I will appreciate if you can help me

 

Thanks in advance.


Viewing all articles
Browse latest Browse all 2738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>