VMware {code} Community
jdictos
Contributor
Contributor

Invalid parameter when creating virtual machine

I am trying to restore a VM from 4.1 vcenter, to 4.0 esxi. It gets pretty far along, creates the vmdk's, then fails and un-rolls with an invalid param. Everything works fine if I do not specify the virtual disk device in the device change spec. The logs on the esxi servers are not very helpful either; they are attached to this post.

0 Kudos
4 Replies
BenN
Enthusiast
Enthusiast

Shouldn't the controllerKey for the VirtualDisk be 1000, not 800?

jdictos
Contributor
Contributor

Actually the controller key is 1000 in the soap request:

- <ns1:deviceChange>
  <ns1:operation>add</ns1:operation>
  <ns1:fileOperation>create</ns1:fileOperation>
- <ns1:device xsi:type="ns1:VirtualDisk">
  <ns1:key>2000</ns1:key>
- <ns1:deviceInfo>
  <ns1:label>Hard disk 1</ns1:label>
  <ns1:summary>10,485,760 KB</ns1:summary>
  </ns1:deviceInfo>
- <ns1:backing xsi:type="ns1:VirtualDiskFlatVer2BackingInfo">
  <ns1:fileName>[datastore2]  HYDROGEN/HYDROGEN.vmdk</ns1:fileName>
  <ns1:datastore  xsi:type="ns1:ManagedObjectReference" type="Datastore">4d5151ac-f89f8eac-0540-001a926145e2</ns1:datastore>
  <ns1:diskMode>persistent</ns1:diskMode>
  <ns1:contentId>f128425caefededf5621cba3c3879fcb</ns1:contentId>
  </ns1:backing>
  <ns1:controllerKey>1000</ns1:controllerKey>
  <ns1:unitNumber>1</ns1:unitNumber>
  <ns1:capacityInKB>10485760</ns1:capacityInKB>
- <ns1:shares>
  <ns1:shares>1000</ns1:shares>
  <ns1:level>normal</ns1:level>
  </ns1:shares>
- <ns1:storageIOAllocation>
  <ns1:limit>-1</ns1:limit>
- <ns1:shares>
  <ns1:shares>1000</ns1:shares>
  <ns1:level>normal</ns1:level>
  </ns1:shares>
  </ns1:storageIOAllocation>
  </ns1:device>
  </ns1:deviceChange>

I actually figured out what was causing the invalid param though, its the unit number again. If i restore using the original unit number things work. I have to figure out what the proper setting for unit numbers are I suppose, as I initially reset the unit numbers after a restore failing in another configuration.

0 Kudos
jdictos
Contributor
Contributor

I'm not quite sure why the controller key shows 800 in the logs when I set the unit number. I don't understand what unit number does. When I set the unit number for all devices to 0 things work, and as the logs show the controller key remains what I set it to for the virutal disk, 10000.

So, I guess the question is, what does the unit number do, and what should it be set to for a virtual machine re-creation?

0 Kudos
jdictos
Contributor
Contributor

After doing some reading, unitNumber is a number relative to the controller, that has to be unique, to identify the device within the controller.


Problem solved, thanks.

0 Kudos