VMware Cloud Community
anurag2189
Enthusiast
Enthusiast
Jump to solution

vim-cmd diskaddexisting scsi1 1 attempts to add existing vmdk into scsi0 and fails

For automation, I use vim-cmd  utility to add existing devices as hot add into VMs.

Before running below command there are disks attached to ScsiController 0 with unit id 1,2,3,4,5,6 and when i try to add a next device for Scsi controller 1 with unit id 1 it fails,

Cmd - vim-cmd vmsvc/device.diskaddexisting 3  /vmfs/volumes/esx_ld7/esx_ld7_1527840895.vmdk scsi1 1

Failed: Reconfigure failed

When I started looking for exact issue as per the hostd.log,

2018-06-01T13:22:12.563Z warning hostd[2099399] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/5b10f081-1bc2e1d0-c444-98f2b3f236a6/Deploy_VMWin/Deploy_VMWin.vmx opID=vim-cmd-5e-3819 user=root] The specified controller slot is already occupied by Hard Disk 2: (vim.vm.device.VirtualDisk) {

-->    key = -1,

-->    deviceInfo = (vim.Description) null,

-->    backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {

-->       fileName = "[] /vmfs/volumes/esx_ld7/esx_ld7_1527840895.vmdk",

-->       datastore = <unset>,

-->       backingObjectId = <unset>,

-->       diskMode = "persistent",

-->       split = <unset>,

-->       writeThrough = <unset>,

-->       thinProvisioned = <unset>,

-->       eagerlyScrub = <unset>,

-->       uuid = <unset>,

-->       contentId = <unset>,

-->       changeId = <unset>,

-->       parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) null,

-->       deltaDiskFormat = <unset>,

-->       digestEnabled = <unset>,

-->       deltaGrainSize = <unset>,

-->       deltaDiskFormatVariant = <unset>,

-->       sharing = <unset>,

-->       keyId = (vim.encryption.CryptoKeyId) null

-->    },

-->    connectable = (vim.vm.device.VirtualDevice.ConnectInfo) null,

-->    slotInfo = (vim.vm.device.VirtualDevice.BusSlotInfo) null,

-->    controllerKey = 1000,

-->    unitNumber = 1,

-->    vDiskId = (vim.vslm.ID) null,

-->    virtualDiskFormat = <unset>,

-->    nativeUnmanagedLinkedClone = <unset>

--> }

2018-06-01T13:22:12.564Z warning hostd[2099399] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/5b10f081-1bc2e1d0-c444-98f2b3f236a6/Deploy_VMWin/Deploy_VMWin.vmx opID=vim-cmd-5e-3819 user=root] Method fault exception during reconfigure: N3Vim5Fault17InvalidDeviceSpec9ExceptionE(Fault cause: vim.fault.InvalidDeviceSpec

--> )

--> [context]zKq7AVICAgAAAJz7cgAVaG9zdGQAAEyZNWxpYnZtYWNvcmUuc28AAADAGwBgsBcB/1r9bGlidmltLXR5cGVzLnNvAIGiMRYBgc6GFgGBoLIWAYEutBYBgX6fEgECYotlaG9zdGQAAsoZuwJe6a4Cw+2ugTVDAQECkcLBAonLwQD1LygA0zMoAAsPNgNrgABsaWJwdGhyZWFkLnNvLjAABJ2ZDmxpYmMuc28uNgA=[/context]

2018-06-01T13:22:12.579Z info hostd[2099399] [Originator@6876 sub=Vimsvc.TaskManager opID=vim-cmd-5e-3819 user=root] Task Completed : haTask-3-vim.VirtualMachine.reconfigure-2656923718 Status error

Surprisingly,

When I ran below command it passed and added the disk against SCSI controller 0, not 1

vim-cmd vmsvc/device.diskaddexisting 3  /vmfs/volumes/esx_ld7/esx_ld7_1527840895.vmdk scsi1 8

As per .vmx file entries are,

scsi0:8.deviceType = "scsi-hardDisk"

scsi0:8.fileName = "/vmfs/volumes/5b10f551-104555a6-b83b-98f2b3f236a6/esx_ld7_1527840895.vmdk"

scsi0:8.present = "TRUE" 

scsi0:8.redo = ""      

Can anyone please guide me here, there seems to be some issue.

0 Kudos
1 Solution

Accepted Solutions
continuum
Immortal
Immortal
Jump to solution

Does the second scsi-controller already exists before you run the command ?
Make sure you already have
scsi1.present = "TRUE"
I also think your syntax is incorrect - try
vim-cmd vmsvc/device.diskaddexisting 3  /vmfs/volumes/esx_ld7/esx_ld7_1527840895.vmdk   1   1


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

View solution in original post

2 Replies
continuum
Immortal
Immortal
Jump to solution

Does the second scsi-controller already exists before you run the command ?
Make sure you already have
scsi1.present = "TRUE"
I also think your syntax is incorrect - try
vim-cmd vmsvc/device.diskaddexisting 3  /vmfs/volumes/esx_ld7/esx_ld7_1527840895.vmdk   1   1


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

anurag2189
Enthusiast
Enthusiast
Jump to solution

scsi1.present = "TRUE" is already set in the vmx file.

But the suggested command is working fine.. I wonder how come earlier command with input as "scsi0 1" was working :smileyconfused:.

0 Kudos