mdvlinguest
Contributor
Contributor

Incompatible device backing error when editing network adapter

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.

0 Kudos
2 Replies
_vladi_
VMware Employee
VMware Employee

Hi,

 

This is not related to the Web Client SDK.

It seems like you are using the Web Services SDK so please ask your question on the vSphere Management SDK forum.

 

Cheers,

Vladimir

0 Kudos
_vladi_
VMware Employee
VMware Employee

Hi,

 

This is not related to the Web Client SDK.

It seems like you are using the Web Services SDK so please ask your question on the vSphere Management SDK forum.

Thanks.

 

Cheers,

Vladimir

0 Kudos