Hello,
I want to know any esxcli command or path* that i can cheek the LUN that available(Not been added as datastore yet) to add ESXi Host without using vSphere client or web client?
(I mean by Path* for Ex :-/vmfs/devices/disk)
try this
esxcli storage filesystem list
hello arathore,
I tried that as you can see the result just show the datastore which already added to esxi host .
what i want is to show the Disk\LUN been presented from storage side to ESXi Host but not added to it yet.
~ # esxcli storage filesystem list
Mount Point Volume Name UUID
------------------------------------------------- ---------------------------- -------------------------------
/vmfs/volumes/52c2a759-95d455c2-776a-5cf9dd36dd69 VLSMTJR01 52c2a759-95d455c2-776a-5cf9dd36
/vmfs/volumes/52ce537b-18ce5d77-899e-5cf9dd36dd69 VMAXTJR01 52ce537b-18ce5d77-899e-5cf9dd36
/vmfs/volumes/536fe2d2-65b03058-005d-5cf9dd36dd76 VLEFTJR01 536fe2d2-65b03058-005d-5cf9dd36
Try this: esxcli storage core device partition showguid | grep -i n/a
Check if the following snippet of shell code does the job for you:
esxcli storage core device list | egrep '^[^ ]+' | while read disk
do
esxcfg-scsidevs --vmfs | if ! grep -q "$disk"
then
echo -e "$disk is not mapped to any VMFS"
fi
done
Edit: Faulty VMFS-check logic has been amended.
It just rotates through every block storage device and checks if it's mapped to an existing VMFS volume.
Apparently there is no such operation
This should work.
create a below .sh script and execute
esxcfg-scsidevs -c|awk '{print $1}'|cut -d"." -f2|grep -v Device >/var/tmp/all_disks
esxcfg-scsidevs --vmfs>/var/tmp/assigned_disks
for i in `cat /var/tmp/all_disks`
do
cat /var/tmp/assigned_disks|grep -q $i
F=$?
if [ $F -gt 0 ]
then
echo $i
fi
done