VMware Cloud Community
PaulNSW
Contributor
Contributor
Jump to solution

Identifying native and upgrade VMFS5 LUNs

Is there a way to determine which VMFS LUNs are native VMFS5 and which are upgraded from a previous version?

Tags (1)
1 Solution

Accepted Solutions
MKguy
Virtuoso
Virtuoso
Jump to solution

I can think of 2 possible ways to determine if a volume was upgraded or natively formatted with VMFS5.

First, check the VMFS blocksize. If you see a blocksize greater than 1MB for VMFS5, you instantly know the volume was upgraded. You can use the regular vSphere Client GUI to check your Datastore or use this powercli snippet to list all your Datastores and their VMFS version:

Get-Datastore | %{ (Get-View $_).Info.Vmfs | select Name, BlocksizeMb, Version }

Name                                                                                                     BlockSizeMb Version
----                                                                                                     ----------- -------
UPGRADED_VMFS5                                                                                                 8 5.54
OLD_VMFS3                                                                                                            8 3.46
PROBABLY_NATIVE_VMFS5                                                                                    1 5.54

This of course doesn't tell if a 1MB blocksize VMFS3 was upgraded or not.

The 2nd way is to check is if the disk device is using a GPT instead of MBR partition table. Upgraded volumes will retain MBR while new ones are created with GPT. There is one corner-case scenario though: An upgraded VMFS3 volume will also change to GPT if you extend the VMFS beyond 2TB after the upgrade. This behavior is described here:

http://blogs.vmware.com/vsphere/2011/12/upgraded-vmfs-5-automatic-partition-format-change.html

http://kb.vmware.com/kb/2003813

If you don't have LUNs larger than 2TB or you are sure to have never extended volumes like this, this should be a surefire way to tell from the ESXi shell:

~ # partedUtil getptbl [Disk Device Path]
~ # partedUtil getptbl /vmfs/devices/disks/naa.600508b40010439a0000b00000360000
gpt
19581 255 63 314572800
1 128 314568764 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

The following snippet will run against all VMFS volumes active on the host being executed on:

~ # esxcfg-scsidevs -m | awk {'print $1'} | sed -e 's/\:1//' | while read device; do echo -e "\n$device"; partedUtil getptbl /vmfs/devices/disks/$device ; done;
-- http://alpacapowered.wordpress.com

View solution in original post

Reply
0 Kudos
10 Replies
MKguy
Virtuoso
Virtuoso
Jump to solution

I can think of 2 possible ways to determine if a volume was upgraded or natively formatted with VMFS5.

First, check the VMFS blocksize. If you see a blocksize greater than 1MB for VMFS5, you instantly know the volume was upgraded. You can use the regular vSphere Client GUI to check your Datastore or use this powercli snippet to list all your Datastores and their VMFS version:

Get-Datastore | %{ (Get-View $_).Info.Vmfs | select Name, BlocksizeMb, Version }

Name                                                                                                     BlockSizeMb Version
----                                                                                                     ----------- -------
UPGRADED_VMFS5                                                                                                 8 5.54
OLD_VMFS3                                                                                                            8 3.46
PROBABLY_NATIVE_VMFS5                                                                                    1 5.54

This of course doesn't tell if a 1MB blocksize VMFS3 was upgraded or not.

The 2nd way is to check is if the disk device is using a GPT instead of MBR partition table. Upgraded volumes will retain MBR while new ones are created with GPT. There is one corner-case scenario though: An upgraded VMFS3 volume will also change to GPT if you extend the VMFS beyond 2TB after the upgrade. This behavior is described here:

http://blogs.vmware.com/vsphere/2011/12/upgraded-vmfs-5-automatic-partition-format-change.html

http://kb.vmware.com/kb/2003813

If you don't have LUNs larger than 2TB or you are sure to have never extended volumes like this, this should be a surefire way to tell from the ESXi shell:

~ # partedUtil getptbl [Disk Device Path]
~ # partedUtil getptbl /vmfs/devices/disks/naa.600508b40010439a0000b00000360000
gpt
19581 255 63 314572800
1 128 314568764 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

The following snippet will run against all VMFS volumes active on the host being executed on:

~ # esxcfg-scsidevs -m | awk {'print $1'} | sed -e 's/\:1//' | while read device; do echo -e "\n$device"; partedUtil getptbl /vmfs/devices/disks/$device ; done;
-- http://alpacapowered.wordpress.com
Reply
0 Kudos
TomHowarth
Leadership
Leadership
Jump to solution

MKGuy, the second way is the only sure fire way of veryifying if a VMFS Datastore in Native VMFS5 or has been upgraded,  remember VMFS 3 had a 1MB block ability too, with Datastores less than 256GB.

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
MKguy
Virtuoso
Virtuoso
Jump to solution

Yes, that's why I mentioned that the first way does not tell anything about volumes that initially already used a 1MB blocksize at the time of the upgrade.

And remember, the blocksize affected the maximum file size only and not the datastore size 🙂 .

-- http://alpacapowered.wordpress.com
Reply
0 Kudos
TomHowarth
Leadership
Leadership
Jump to solution

agreed

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
Reply
0 Kudos
PaulNSW
Contributor
Contributor
Jump to solution

Thanks for that! Much appreciated!

Reply
0 Kudos
schepp
Leadership
Leadership
Jump to solution

Hey, got bored so here's a oneliner to be executed on an ESXi bash via ssh, to show Name, VMFS version and if it is VMFS 5 if it was upgraded or is native. Native and Upgraded differ in the max file value. Have fun Smiley Wink

esxcfg-scsidevs -m |awk {'print $5'}|while read volume;do VMFSv=$(vmkfstools -Pv 10 /vmfs/volumes/$volume | grep VMFS | awk {'print $1'}); max=$(vmkfstools -Pv 10 /vmfs/volumes/$volume | grep Files | awk {'print $3'} | cut -d "/" -f1);if [ $(echo $VMFSv | cut -c 6) == "5" ];then if [ "$max" -eq "30720" ];then version="Upgraded VMFS 5";else version="Native VMFS 5";fi;else version="";fi; echo -e "$volume  $VMFSv  $version";done

TomHowarth
Leadership
Leadership
Jump to solution

You must have been bored LOL Smiley Wink Nice script though

Tom Howarth VCP / VCAP / vExpert
VMware Communities User Moderator
Blog: http://www.planetvm.net
Contributing author on VMware vSphere and Virtual Infrastructure Security: Securing ESX and the Virtual Environment
Contributing author on VCP VMware Certified Professional on VSphere 4 Study Guide: Exam VCP-410
Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

schepp when I run this script this is just showing the vmfs version and not showing whether it is upgraded or not. Have a look at my output

~ # esxcfg-scsidevs -m |awk {'print $5'}|while read volume;do VMFSv=$(vmkfstools -Pv 10 /vmfs/volumes/$volume | grep VMFS | awk {'print $1'}); max=$(vmkfstools -Pv 10 /vmfs/volumes/$volume | grep F

iles | awk {'print $3'} | cut -d "/" -f1);if [ "$VMFSv" == "VMFS-5.54" ];then if [ "$max" -eq "30720" ];then version="Upgraded VMFS 5";else version="Native VMFS 5";fi;else version="";fi; echo -e "$

volume $VMFSv  $version";done

datastore_1 VMFS-5.60

FCdatastore VMFS-3.60

~ # esxcfg-scsidevs -m |awk {'print $5'}|while read volume;do VMFSv=$(vmkfstools -Pv 10 /vmfs/volumes/$volume | grep VMFS | awk {'print $1'}); max=$(vmkfstools -Pv 10 /vmfs/volumes/$volume | grep F

iles | awk {'print $3'} | cut -d "/" -f1);if [ "$VMFSv" == "VMFS-5.54" ];then if [ "$max" -eq "30720" ];then version="Upgraded VMFS 5";else version="Native VMFS 5";fi;else version="";fi; echo -e "$

volume $VMFSv  $version";done

datastore_1 VMFS-5.60

FCdatastore VMFS-5.60

In the above case I have upgraded FCdatastore vmfs version to 5 but it just show the name and version.

Reply
0 Kudos
schepp
Leadership
Leadership
Jump to solution

Alex Thomas yes it was only looking for that specific minor version of VMFS 5.

Changed it to work with all 5.X version:


esxcfg-scsidevs -m |awk {'print $5'}|while read volume;do VMFSv=$(vmkfstools -Pv 10 /vmfs/volumes/$volume | grep VMFS | awk {'print $1'}); max=$(vmkfstools -Pv 10 /vmfs/volumes/$volume | grep Files | awk {'print $3'} | cut -d "/" -f1);if [ $(echo $VMFSv | cut -c 6) == "5" ];then if [ "$max" -eq "30720" ];then version="Upgraded VMFS 5";else version="Native VMFS 5";fi;else version="";fi; echo -e "$volume  $VMFSv  $version";done

admin
Immortal
Immortal
Jump to solution

Awesome, thats great, working fine now Smiley Happy thanks

Reply
0 Kudos