Reclaiming old VSAN disks from disk groups

This was a surprise “how-to” I wanted to figure out because I’m lazy.

I had a few lab VSAN nested hosts that I wanted to repurpose rather than rebuild.  I disabled VSAN and removed the fake SSDs, but couldn’t reformat the other disks into a local datastore.

I thought at first was a claim rule, but a showing of those from ESXCLI came up with just defaults.
In the vSphere Client, I found my answer in the Storage -> Devices section:

Note the "Capacity" section.

Error under capacity: “PartitionType.0xfa not found.”  New one on me – now how to clear it or fix?

To clear the partition data, you can use partedUtil through SSH.  Note that the command is case-sensitive to execute!

First, get the device ID from the above and run this command to enumerate the partition data:

~ # partedUtil get /vmfs/devices/disks/mpx.vmhba1:C0:T2:L0
39162 255 63 629145600
1 2048 6143 0 0
2 6144 629145566 0 0

Not much there, it essentially matches what’s in the client. But then you can try another command:

~ # partedUtil getptbl /vmfs/devices/disks/mpx.vmhba1\:C0\:T2:L0
gpt
39162 255 63 629145600
1 2048 6143 381CFCCC728811E092EE000C2911D0B2 vsan 0
2 6144 629145566 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

Ding!  Partition 1 is tagged as VSAN still.  It makes sense that the client would report inability to see it, as it isn’t designed to manage VSAN.

So what does the Web Client say?

vsan-disk-reclaim-deviceerror-webclient

Oh.  It doesn’t even recognize itself anymore!

You can try to fix it with partedUtil fixGpt <disk>,  detach the LUN and re-attach.  If that doesn’t work, you can delete the partition in question.

~ # partedUtil delete /vmfs/devices/disks/mpx.vmhba1\:C0\:T2:L0 1

Now, check the device table…

~ # partedUtil getptbl /vmfs/devices/disks/mpx.vmhba1\:C0\:T2:L0
gpt
39162 255 63 629145600
2 6144 629145566 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

That looks (relatively) better – now to verify things, you will have to detach the LUN and re-attach.

vsan-disk-reclaim-deviceerror-fixed

You can now go to Add Datastore, and reformat the disk for usage.

Hopefully someone will find this useful for home setups or leading you down the path to partition tools that you can use to recover one that has failed!

 

How do you really start to write?

The answer is pretty simple: you just start doing it.  And you keep doing it until it turns into something.

I have started blogs before, written a couple of bits, and left it to die.  In truth I was just too distracted, always pulled in other directions.

This time, I think I have things I want to talk about, but more importantly I want to share and give back.  As I started out as a junior sysadmin, the internet was the firehose of information that I stood in front of, to absorb and hopefully learn from it.  I did, and it was good.  Allegedly.

But now in a much better place in my own career and life in general, I want to give back, but with an opinionated slant.

This blog will be about virtualization to some degree.  It will be a good bit of programming and my terrible attempts at it sometimes.  It will be about projects I’m working on, the pros and cons I’ve found, and maybe even some scathing remarks about the underlying technology.

Yes, it will be lots of VMware tech.  I’m currently a VCAP5 guy, which means I probably spent more than you did on an exam in the past.

It will be about cloud integration, automation, orchestrator tools.

It will be about bizarre use cases I’ve had to deal with and will deal with.

My name is Justin and so far, I’m at about 250 words.  And that’s where I’m going to start.