Hello,
I'm trying to add a rdm LUN to a VM using the powershell cmd-let New-HardDisk
The VM is hosted in a vsphere server (IBM HS22) with latest updates. The host is managed by vcenter and is part of a cluster with 5 other servers
The exact command is:Get-VM $vm | New-HardDisk -DiskType "rawPhysical" -DeviceName "/vmfs/devices/disks/vmhba1:C0:T1:L6"
I get the following error message:
New-HardDisk : 11/5/2009 10:45:04 AM New-HardDisk 523d72ad-fda3-6c7b-a869-52f690e4c63b The operation for the entity 64 failed with the following message: "File is larger than the maximum size supported by datastore 'DATASTORE-PROD01'.
TESTVM2/TESTVM2_3.vmdk"
At D:\scripts\add-rawdisk.ps1:11 char:26
+ Get-VM $vm | New-HardDisk <<<< -DiskType "rawPhysical" -DeviceName "/vmfs/devices/disks/vmhba1:C0:T1:L6"
I've tried with another VM, Datastore and vsphere server.
I don't understand why I get this error because it is a rdm and the rdm LUN is only 20 GB very below the first limit that is 256 GB when block size is set to 1 MB
Your help would be very appreciated.
Sylvain
Is there 20Gb free on the datastore where your guest is residing ?
I know that the mapping file (*-rdmp.vmdk) doesn't take the actual space on the datastore but it will be marked as such.
Perhaps a check takes uses that size to determine if there is enough free space available ?
Does it work from the vSphere client ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
There is enough space on the datastore. I tried to move the VM on another datastore and I get the same message. From the vsphere client, the rdm is mapped successfully. I dis the test connecting to vcenter and directly to the esx and I get the same error.
Adding a flat vmdk produce no error.
I could reproduce your problem, you need to specify the DeviceName as it is listed in the DeviceName property of the HostScsiDisk object..
Use this script to list the DeciveName property
$hostStor = Get-VMHost <esx-hostname> | Get-VMHostStorage | Get-View $hostStor.StorageDeviceInfo.ScsiLun | Select DeviceName
An alternative is to use the "esxcfg-mpath -l" command and use the Device value.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you very much LucD. I changed the device name format and it is working now. As in vmware ESX 3.5, the format was hbaX:X:X:X, I though we had to use the new runtime name of vsphere.
I had the same problem with vSphere 4.
I found out that my LUN was set offline on my NetApp. I set the LUN back online and rescanned my fibre channel storage adapters. After that i was able to add the RDM LUN, without the misleading error message (.vmdk is larger than the maximum size supported by datastore).