Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to add RDM disk to VM got error "Incompatible device backing specified for device '0'". #119

Closed
3 tasks done
14kosta opened this issue Nov 27, 2018 · 15 comments
Closed
3 tasks done
Assignees

Comments

@14kosta
Copy link

14kosta commented Nov 27, 2018

Environment

  • sdk package version:

(vSphere_sdk_virt_env) [root@SIOVM-9 ~]# pip list | grep v
pyvmomi 6.7.1
vapi-client-bindings 1.5.0
vapi-common-client 2.10.2
vapi-runtime 2.10.2
vapi-vmc-client 2.10.2
vmc-app-python-sdk 2.2.0.0.0.15184434
vmc-client-bindings 1.3.0
(vSphere_sdk_virt_env) [root@SIOVM-9 ~]#

  • python version:

(vSphere_sdk_virt_env) [root@SIOVM-9 ~]# python --version
Python 3.5.1
(vSphere_sdk_virt_env) [root@SIOVM-9 ~]#

  • vSphere version:
    Version 6.7.0.1150 Build 8170132

  • Operating System/Shell (used to run SDK-based apps):
    Red Hat 7.3

Steps or code snippet to reproduce

I attached the sample code that i used. failed the function add_remove_vm_disk. Other functions succeeded.
vsphere_api_1.zip

Problem description:
Hi,

Trying to add device /vmfs/devices/disks/eui.57df0280647efa2de9751c5d0000000a as RDM disk to VM I do the following

  1. Create meta and flat vdmk files in the datastore_path:
    datastore_root_path = "[vm1_thick] RHEL70_thick13"
    datastore_path = datastore_root_path + '/RHEL70_thick13_2.vmdk'

by running
vdm = service_instance.content.virtualDiskManager
task = vdm.CreateVirtualDisk(
datastore_path, datacenter_mo,
vim.VirtualDiskManager.DeviceBackedVirtualDiskSpec(
diskType='rdmp', adapterType='lsiLogic',
device = "/vmfs/devices/disks/eui.57df0280647efa2de9751c5d0000000a"))
pyVim.task.WaitForTask(task)

After this call in the directory
/vmfs/volumes/vm1_thick/RHEL70_thick13 appear meta file RHEL70_thick13_2.vmdk and disk file RHEL70_thick13_2-rdmp.vmdk

  1. Run the following code adapted from https://github.com/vmware/vsphere-automation-sdk-python/tree/master/samples/vsphere/vcenter/vm/hardware/disk.py

     disk_create_spec = Disk.CreateSpec(
         type=Disk.HostBusAdapterType.SCSI,
         backing=Disk.BackingSpec(type=Disk.BackingType.VMDK_FILE,
                                  vmdk_file=datastore_path))
     disk = self.client.vcenter.vm.hardware.Disk.create(vm=self.vm, spec=disk_create_spec)
    
  2. Got the following error:
    File "/root/vmware/vsphere_api.py", line 320, in add_remove_vm_disk
    disk = self.client.vcenter.vm.hardware.Disk.create(vm=self.vm, spec=disk_create_spec)
    File "/root/vSphere_sdk_virt_env/lib/python3.5/site-packages/com/vmware/vcenter/vm/hardware_client.py", line 2634, in create
    'spec': spec,
    File "/root/vSphere_sdk_virt_env/lib/python3.5/site-packages/vmware/vapi/bindings/stub.py", line 317, in _invoke
    return self._api_interface.native_invoke(ctx, _method_name, kwargs)
    File "/root/vSphere_sdk_virt_env/lib/python3.5/site-packages/vmware/vapi/bindings/stub.py", line 275, in native_invoke
    self._rest_converter_mode)
    com.vmware.vapi.std.errors_client.InvalidArgument: {messages : [LocalizableMessage(default_message="Incompatible device backing specified for device '0'.", args=[], id='vmsg.InvalidDeviceBacking.summary')], data : None}

  3. PowerCli command
    New-HardDisk -VM RHEL70_thick13 -DiskType RawPhysical -DeviceName /vmfs/devices/disks/eui.57df0280647efa2de9751c5d0000000a

and RDM disk addition though vSphere client work OK and querying the disks shows that I gave correct parameters in the above functions.

Can you advise please what is the problem and how to solve it?
Thanks

Actual behavior

Get the following exception:
com.vmware.vapi.std.errors_client.InvalidArgument: {messages : [LocalizableMessage(default_message="Incompatible device backing specified for device '0'.", args=[], id='vmsg.InvalidDeviceBacking.summary')], data : None}

Expected behavior

Added RDM disk to VM

@tianhao64
Copy link
Contributor

@14kosta Apologies for the late response.

Can you try to comment out "type=Disk.HostBusAdapterType.SCSI," when creating the Disk.CreateSpec?

If it's still not working. Could you please post the stacktrace from /var/log/vmware/vpxd/vpxd.log so we get more info?

@14kosta
Copy link
Author

14kosta commented Jan 10, 2019

Hi tianhao64,
Commenting out "type=Disk.HostBusAdapterType.SCSI," doesn't help - I get the same error.
Attaching vpxd.log
vpxd.zip

Thank you

@tianhao64
Copy link
Contributor

@14kosta Hmm. the log doesn't have related error message. Will ask the storage expert to take a look. Meanwhile, can you check this post? https://cormachogan.com/2013/04/08/microsoft-clustering-on-vsphere-incompatible-device-errors/

@14kosta
Copy link
Author

14kosta commented Jan 11, 2019

Hi tianhao64,
I looked at the sent by you link. My configuration is the following: I have SCSI device /vmfs/devices/disks/eui.57df0280647efa2de9751c5d0000000 that is seen on three ESXi hosts. Then I attaching it to VM that is on one of ESXi hosts and the command fails thru SDK, but succeeded thru PowerCli and Web client. Situation described in the sent link looks for me a little bit different.
Thank you

@tianhao64
Copy link
Contributor

I filed a SR against the storage team. Will keep you posted. Can you check hostd.log see if you see related error message?

@14kosta
Copy link
Author

14kosta commented Jan 11, 2019

Command "find / -name hostd" doesn't return any hostd.log on vCenter or ESXi. Where to search for it?
BTW, in debugger I see that the error comes from requests module i.e. really comes from a server side.

@Pyaray77
Copy link

Modern versions of ESXi keep the hostd.log in /var/run/log. Generally when you pull down a vm-support, the files will be gzip'ed

@14kosta
Copy link
Author

14kosta commented Jan 13, 2019

when I run RDM mapping in the file /var/log/hostd.log (which is the link to /var/run/log/hostd.log) appears the following error:
2019-01-13T10:02:19.576Z info hostd[2099318] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/5bdb7b78-27334b79-c9e6-2c600c66a3ff/RHEL70_thick13/RHEL70_thick13.vmx opID=2aebc039-01-e6-9f95 user=vpxuser:AUTO01.LOCAL\Administrator] Send config update invoked
2019-01-13T10:02:19.611Z info hostd[2099318] [Originator@6876 sub=Libs opID=2aebc039-01-e6-9f95 user=vpxuser:AUTO01.LOCAL\Administrator] DictionaryLoad: Cannot open file "/usr/lib/vmware/config": No such file or directory.
2019-01-13T10:02:19.611Z info hostd[2099318] [Originator@6876 sub=Libs opID=2aebc039-01-e6-9f95 user=vpxuser:AUTO01.LOCAL\Administrator] Could not expand environment variable HOME.
2019-01-13T10:02:19.611Z info hostd[2099318] [Originator@6876 sub=Libs opID=2aebc039-01-e6-9f95 user=vpxuser:AUTO01.LOCAL\Administrator] DictionaryLoad: Cannot open file "~/.vmware/config": No such file or directory.
2019-01-13T10:02:19.614Z info hostd[2099318] [Originator@6876 sub=Vimsvc.TaskManager opID=2aebc039-01-e6-9f95 user=vpxuser:AUTO01.LOCAL\Administrator] Task Completed : haTask-5-vim.VirtualMachine.reconfigure-1122499 Status error
2019-01-13T10:02:19.614Z warning hostd[2099318] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/5bdb7b78-27334b79-c9e6-2c600c66a3ff/RHEL70_thick13/RHEL70_thick13.vmx opID=2aebc039-01-e6-9f95 user=vpxuser:AUTO01.LOCAL\Administrator] Reconfigure failed

@14kosta
Copy link
Author

14kosta commented Jan 13, 2019

Hi tianhao64,
I run RDM mapping and simultaneously took vpxd.log (attached to this message) and hostd.log
(see the previous message).
In the current vpxd.log appears "Incompatible device backing specified for device '0'.":
vim.fault.InvalidDeviceBacking:
--> Result:
--> (vim.fault.InvalidDeviceBacking) {
--> faultCause = (vmodl.MethodFault) null,
--> faultMessage = ,
--> property = ,
--> deviceIndex = 0
--> msg = "Incompatible device backing specified for device '0'."
--> }
vpxd.zip

@14kosta
Copy link
Author

14kosta commented Jan 16, 2019

Hi tianhao64,
Any news about this issue?

@tianhao64
Copy link
Contributor

No update from the feature team yet. Will ping them again.

@14kosta
Copy link
Author

14kosta commented Jan 17, 2019

@tianhao64 , thank you!

@anusha94
Copy link
Contributor

@tianhao64
Was there any progress from the feature team?

@14kosta
Do you know if this issue still exists with the latest SDK?

@14kosta
Copy link
Author

14kosta commented Mar 16, 2021 via email

@anusha94
Copy link
Contributor

@14kosta
I am very sorry to hear that. The teams are distributed and features sometimes don't make it to the priority list and are kept hanging. We will try to fix this gap in the future.
Glad you were able to resolve with powercli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants