How to detect VMFS3 and VMFS3 Upgraded Datastores with PowerCLI; Now with more sugar!

July 19th, 2013
by Christopher Kusek (PKGuild)

You’re not new to Virtualization, this isn’t your first VMware rodeo, but you find yourself starting to question… OMG DO I HAVE VMFS3 DATASTORES STEATHILY HIDING IN MY SYSTEM?! I mean you do your due diligence, you check and confirm that it says VMFS5 and that it has a 1MB (Universal) block size, but yet… you’re still not sure… Hell, you might even be saying WTF? 1MB BLOCK SIZES? WTFS?!  Well, hopefully this helps break through some of the barriers to not only identify whether you have VMFS3 datastores period, whether they’re actually stealthily hiding!

What’s the big deal with upgrading VMFS3 to VMFS5?

Yea, you read the VMware documentation like this; How VMFS5 Differs from VMFS3 – Basically by reading that you come to the conclusion of ITS EASY, JUST DO IT, YAY!  But to quote Jason Corbett @NGTJason “migrate > upgrade”

Why exactly though? I mean if you read what Cormac Hogan @VMwareStorage wrote so long ago vSphere 5.0 Storage Features Part 1 – VMFS-5 you might be pressured to believe that it’s all good, caveats aside that your VMFS5 upgraded datastores will rock out just like VMFS3, but take a gander at Jason Boche @JasonBoche VMFS-5 VMFS-3, What’s the Deal?

Differences between upgraded and newly created VMFS-5 datastores:

VMFS-5 upgraded from VMFS-3 continues to use the previous file block size which may be larger than the unified 1MB file block size. Copy operations between datastores with different block sizes won’t be able to leverage VAAI.  This is the primary reason I would recommend the creation of new VMFS-5 datastores and migrating virtual machines to new VMFS-5 datastores rather than performing in place upgrades of VMFS-3 datastores.
VMFS-5 upgraded from VMFS-3 continues to use 64KB sub-blocks and not new 8K sub-blocks.
VMFS-5 upgraded from VMFS-3 continues to have a file limit of 30,720 rather than the new file limit of > 100,000 for newly created VMFS-5.
VMFS-5 upgraded from VMFS-3 continues to use MBR (Master Boot Record) partition type; when the VMFS-5 volume is grown above 2TB, it automatically switches from MBR to GPT (GUID Partition Table) without impact to the running VMs.
VMFS-5 upgraded from VMFS-3 will continue to have a partition starting on sector 128; newly created VMFS-5 partitions start at sector 2,048.

I THINK I HAVE VMFS3 VOLUMES HOW DO I TELL, OMG WHAT IS THAT BURNING SENSATION

Hey, calm down, calm down… I think we can solve this problem pretty easily! And if the burning sensation continues, get that checked out!

I don’t know about you, you might have 1 vCenter, 3 Servers and a handful of Datastores. I have thousands… of EACH, so I needed something to do my scans and checks at scale with PowerCLI because I’m a baller, and apparently I pull that off rather well. :)

Methods of detecting whether you have VMFS3, VMFS3 upgraded to VMFS5 or otherwise mismatched sets..

  • Block Size is greater than 1MB
  • Partition type is msdos instead of gpt (*Detected by checking whether the StartSector is 128 instead of 2048)
  • And of course, your VMFS version is VMFS3 or 3.46

But wait, didn’t you say above that partition types will change from MSDOS to GPT if they’re expanded? Doesn’t that make tracking harder? Yes.

Let’s get our PowerCLI on so we can crack this nut!

Get-Datastore | Get-View | Select-Object Name,@{N="VMFS version";E={$_.Info.Vmfs.Version}},@{N="BlocksizeMB";E={$_.Info.Vmfs.BlockSizeMB}}
// To check VMFS version & block sizes – Really useful to just check in general that your version is 5.54 and your blocksize is 1MB though if you VMFS3->5 In-place upgrade when VMFS3 was 1MB, this won’t reveal itself to you

Get-Datastore | Get-View | Where {$_.Info.Vmfs.Version –eq “3.46”} | Where {$_.Info.Vmfs.BlockSizeMB -eq "1"} | Select-Object Name,@{N="VMFS version";E={$_.Info.Vmfs.Version}},@{N="BlocksizeMB";E={$_.Info.Vmfs.BlockSizeMB}}
// To Check VMFS Version and Block Sizes but only listing mismatches you specify  – so if you want to see if you specifically have any 3.46 VMFS and various block sizes

Busting out the mad $esxcli syntax!

This is where we start to get real. The following examples are simple ‘one-liners’ which are cute and all if you’re checking one host, but I also give you one which will scan EVERYTHING so you can just sit back and bask in the glow of figuring out WTF IS GOING ON WITH THIS BURNING, HELP HELP HELP!

$esxcli.storage.core.device.partition.list() | Select Device, StartSector
// Dumps all Offsets – This can be useful if you want to see a lot of data… but less so if you’re looking for something specific…

$esxcli.storage.core.device.partition.list() | group-Object -Property Device | Where {$_.StartSector –eq “128”} | Select Device, StartSector
// Dumps only offsets which "equal" a startsector, in this case 128 – Now we’re cooking with oil, a StartSector of 128 leans on a datastore being VMFS3 or VMFS5 which had been upgraded from VMFS3

$esxcli.storage.core.device.partition.list() | Where {$_.StartSector -eq "128"} | Select Device, StartSector
// This will dump all of your partitions which have a starting offset of 128, same as above but shorter

Script me baby one more time!

OMG YOU JUST MADE A HORRIBLY DATED REFERENCE TO BRITNEY SPEARS. For what its worth, I believe she did some scripting in her days…   The scenarios below will just ‘do it’ based upon whatever hosts you connected to with Connect-VIServer, obviously the difference being ‘comments’ or not.

foreach ($myHost in get-VMHost)
#This tells the system to do a run the command against all "VMHosts" that you have defined as part of your Connect-VIServer
{
    Write-Host ‘$myHost = ‘ $myHost
    #Display the ESXi Host that it is operating against, helps if you’re scanning multiple vCenters
    $esxcli = Get-EsxCli -VMHost $myHost
    #This sets the syntax and the context for the Get-EsxCli command to operate, a requirement for running $esxcli.Commands
    $esxcli.storage.core.device.partition.list() |
    #Use Get-EsxCli to list the core storage devices
    Where {$_.StartSector -eq "128"} |
    #This specifies we’re only looking for partitions which have a StartSector of 128, which could mean either VMFS3 or VMFS3 upgraded to VMFS5 Datastores
    Select Device, StartSector
    #When all is said and done, it’s nice to see it in a ‘pretty’ format to see what work you need to do!
}

Without Comments

foreach ($myHost in get-VMHost)
{
    Write-Host ‘$myHost = ‘ $myHost
    $esxcli = Get-EsxCli -VMHost $myHost
    $esxcli.storage.core.device.partition.list() |
    Where {$_.StartSector -eq "128"} |
    Select Device, StartSector
}

Now technically you could use partedUtil but that’s a pain in the ass.  – But for the sake of continuity here is the syntax/results!

~ # partedUtil getptbl "/vmfs/devices/disks/naa.60a98000646e4f4b475a6a4975422d66"
msdos
261083 255 63 4194304000
1 128 4194298394 251 0
~ # partedUtil getptbl "/vmfs/devices/disks/naa.60a98000646e4f4b475a70516f34416f"
gpt
534698 255 63 8589934592
1 2048 8589934558 AA31E02A400F11DB9590000C2911D1B8 vmfs 0
~ #

So in case you’re wondering if the script is working properly you should end up with results similar to this below;

Results:
$myHost =  103.domain.local

Device                                                      StartSector
——                                                      ———–
naa.60a98000323764703424434e6246775a                        128
$myHost =  102.domain.local
naa.60a98000323764703424434e6246775a                        128
$myHost =  101.domain.local
naa.60a98000323764703424434e6246775a                        128
$myHost =  037.domain.local

And that is basically all it takes! This hopefully should give you the fuel you need to scan your environment with minimal effort and identify any VMFS3 datastores so you can clean that stuff up and MIGRATE!  I discovered a bunch of them which aren’t so kind, and what ensues is massive migrations!

Good luck out there! and if you can find some good way to hack esxcli to ALSO have it then correlate that data to what the datastore name is… I FAILED :)

Tags: , , , , , , , , ,
Posted in PowerCLI, Storage, Virtualization, vmware, vSphere | Comments (133)

  • http://www.web.e-kabza.pl/sklep/ linkowanie stron

    My programmer is trying to persuade me to move to .net from PHP. I have always disliked the idea because of the costs. But he’s tryiong none the less. I’ve been using WordPress on numerous websites for about a year and am worried about switching to another platform. I have heard good things about blogengine.net. Is there a way I can import all my wordpress posts into it? Any help would be greatly appreciated!

  • Pingback: Certification

  • https://www.youtube.com/watch?v=43VKJI6oJBE&feature=youtu.be dating a married woman

    I wanted to draft you this very little remark so as to thank you once again for the stunning strategies you have shared at this time. It’s unbelievably generous of people like you to allow openly all many people would have sold for an e book to get some bucks on their own, particularly since you could have done it if you considered necessary. Those inspiring ideas in addition served to be a fantastic way to understand that some people have the identical desire just as my own to see way more related to this matter. Certainly there are lots of more enjoyable situations up front for people who find out your site.

  • http://biurorache4.dreamwidth.org Kiersten Grapes

    I worship your wordpress theme, where perform you get a hold of it through?

  • http://radiorespuestas.com/e-juice-reviews/what-is-the-best-vaporizer-weed-vapor-e.asp dekang e-liquid

    e-liquid recipes Christopher Kusek, Technology Evangelist » How to detect VMFS3 and VMFS3 Upgraded Datastores with PowerCLI; Now with more sugar!

  • http://minecraftflix.com/ The #1 minecraft video site

    Way cool! Some extremely valid points! I appreciate you penning this article plus the rest of the site is also really good.

  • http://elderscrolls4go.livejournal.com/ Buy eso gold

    your company is very impressive.

  • http://www.adresyfirm.org/images/regulamin_es.pdf adresyfirm.org

    Hello there, just became alert to your blog through Google, and found that it is really informative. I’m gonna watch out for brussels. I’ll be grateful if you continue this in future. Many people will be benefited from your writing. Cheers!

  • http://sigitmuddikuncoro.com/ Konsultan Seo di Sumatera Barat

    Good post. I learn something new and challenging on sites I stumbleupon on a daily basis. It will always be exciting to read articles from other authors and use something from their websites.

  • http://www.amazon.com/Hemp-Power-Super-Size-Tote/dp/B00J9OR0W4 from Hemp Authority

    This is a topic that’s close to my heart… Many thanks! Exactly where are your contact details though?

  • Pingback: youtube

  • http://tuff-asia.com/e-liquid/liquid-smoke-e-liquids-9329.asp electronic cigarette liquid

    e liquid recipes Christopher Kusek, Technology Evangelist » How to detect VMFS3 and VMFS3 Upgraded Datastores with PowerCLI; Now with more sugar!

  • http://test0r0r0r0.ru test0r0r0 download

    Right here is the perfect site for anybody who really wants to find out about this topic. You understand so much its almost tough to argue with you (not that I personally will need to…HaHa). You definitely put a new spin on a topic which has been discussed for decades. Wonderful stuff, just wonderful!

  • http://www.yesphonecontracts.co.uk/faqs.html Bad credit mobile contracts

    You need to take part in a contest for one of the finest blogs online. I’m going to highly recommend this website!

  • http://studentconsolidationservices.com student loan consolidation

    An intriguing discussion is definitely worth comment. I do think that you need to write more on this subject, it might not be a taboo matter but generally people don’t discuss such subjects. To the next! Kind regards!!

  • http://www.modelambassadorprogram.com/ Model

    Very good article! We will be linking to this great content on our site. Keep up the great writing.

  • http://www.casadomani.de Makler Wiesbaden

    Nice post. I used to be checking constantly this weblog and I’m impressed! Extremely helpful information specially the remaining phase :) I handle such information much. I used to be looking for this particular info for a very lengthy time. Thanks and good luck.

  • http://www.gacukruhture.com/ gacukruhture

    F*ckin’ tremendous things here. I am very happy to see your post. Thanks a lot and i am looking forward to touch you. Will you kindly drop me a e-mail?

  • http://www.sfaleryty.mragowo.pl Burton Haynes

    Zune and iPod: Most people compare the Zune to the Touch, but after seeing how slim and surprisingly small and light it is, I consider it to be a rather unique hybrid that combines qualities of both the Touch and the Nano. It’s very colorful and lovely OLED screen is slightly smaller than the touch screen, but the player itself feels quite a bit smaller and lighter. It weighs about 2/3 as much, and is noticeably smaller in width and height, while being just a hair thicker.

  • Pingback: What is LeadPages?

  • http://www.pmaschofield.com/ bigfoot found today

    Nice post. I learn something totally new and challenging on sites I stumbleupon everyday. It’s always exciting to read content from other authors and practice a little something from other websites.

  • http://pregnancybodypillow.org/ pregnancy pillow snoogle

    Greetings! Very helpful advice within this article! It is the little changes that will make the most significant changes. Thanks for sharing!

  • http://www.laamailukeskus.fi snort this

    A lot of thanks for each of your labor on this web site. My mom really loves setting aside time for investigations and it’s really obvious why. Most of us know all concerning the lively medium you make informative steps through the website and therefore invigorate participation from the others about this situation and our own child is now understanding a lot. Take pleasure in the rest of the new year. You are conducting a dazzling job.

  • http://www.musicbusinessgroup.com/where-to-buy-custom-embroidered-patches http://www.musicbusinessgroup.com/where-to-buy-custom-embroidered-patches

    Hey there! Someone in my Facebook group shared this site with us so I came to look it over. I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers! Excellent blog and brilliant style and design.

  • Pingback: Barber shops in waukegan il

  • http://badcreditautomotive.blogspot.com Helpful Hints

    Viagra…. Hands down, apple’s app store wins by a mile. It’s a huge selection of all sorts of apps vs a rather sad selection of a handful for zune. Microsoft has plans, especially in the realm of games, but i’m not sure I would want to bet on the future if this ….

  • http://www.modcontrollers.net/ rapid fire controller

    Wonderful post! We are linking to this particularly great post on our site. Keep up the good writing.

  • http://bp-style.com landing page

    Hi there! This blog post could not be written any better! Going through this post reminds me of my previous roommate! He continually kept preaching about this. I most certainly will send this information to him. Fairly certain he’s going to have a good read. Many thanks for sharing!

  • http://www.golfballsdirect.co.nz/product-category/new-balls/taylormade-new-balls/ Taylormade Golf balls

    Your style is really unique in comparison to other folks I have read stuff from. Many thanks for posting when you have the opportunity, Guess I’ll just book mark this web site.

  • http://www.lady-maddy.com/ compositeur de musique ambiance

    Right here is the perfect website for anyone who wishes to find out about this topic. You understand a whole lot its almost hard to argue with you (not that I really would want to…HaHa). You certainly put a fresh spin on a subject that’s been discussed for decades. Great stuff, just great!

  • http://www.marshallstearns.com/las-vegas-mls-map-search/ Las Vegas Home Search

    I’d like to thank you for the efforts you have put in writing this blog. I am hoping to check out the same high-grade blog posts from you later on as well. In fact, your creative writing abilities has motivated me to get my own website now ;)

  • http://www.manetworkz2.mex.tl/blog_0.html global MA

    Hello same cool muddle site!! Guy .. Striking .. Amazing .. I will bookmark your website and take the feeds also…I am happy to attain numerous of use in order acceptably here in the suggest, we want work absent additional strategies in this regard, recognition for sharing. . . . . .

  • http://badcreditautomotive.blogspot.com Visit Website

    These batteries could be recharged, however they cost quite a bit of money for the initial purchase.

  • Archives