How does vSphere handle snapshot LUNs

0

What's up? Fellow system admins,

In today's post, we will take a look at how does vSphere handle snapshot LUNs and what are the ways that we can troubleshoot in case the ESXi host recognizes them.

In my previous post, I wrote about how to disable snapshots for a VMware Virtual Machine, for those who are interested, here is the link.

How to disable snapshots on a VMware Virtual Machine

Moving on, there are various ways that you can troubleshoot the issue at hand like using the vSphere Web Client, which I highly recommend.

You can also make use of vSphere Client and also from the command line of the host using a Putty session.

We will first start off using the ESXi shell and then look at the various other options.

You will first need to SSH to the host that is seeing a snapshot of the LUNs presented to it.

esxcli storage vmfs snapshot list

The above command will list any snapshots that are present and the output will look something similar to the below message.

vSphere handle snapshot LUNs

You will also notice that there will be details of the snapshot listing in the vmkernel.log as well.

I am running the below command to find any traces of the same.

grep -i snapshot /var/log/vmkernel.log

vSphere handle snapshot LUNs

You must have noticed that when we ran the first command, it gave us the reason as to why the LUN was not mounted once we rescan the HBA adapters after adding the LUN.

Can mount: false
Reason for un-mountability: the original volume is still online

The reason we are seeing this error is because the original datastore from which I have taken this snapshot is still attached to this ESXi host.

Therefore, the UUID of the original datastore and the snapshot are the same and the ESXi is smart enough to know that there would be a lot of issues that will come up because of this.

So how do we go about resolving this error?

Well, there are a couple of ways that you can go about this, one way would be to unmount and remove the old datastore if you are sure that you will not be needing anymore.

And then add the snapshot LUN keeping the same UUID. This option is called Keeping the existing signature.

The general syntax used to mount an LUN is seen below.

esxcli storage vmfs snapshot mount -l label | -u uuid

In our example, it would be:

esxcli storage vmfs snapshot mount -u 527021ec-3ff82c2b-8f6b-0050560311e9

This LUN will now be persistent across reboots of the ESXi host. If you and add a parameter -n, that will make the LUN as non-persistent.

The other way would be resignature the LUN and give it a new UUID while mounting. This option is called Assigning a new signature.

This is the method that we will be seeing today.

esxcli storage vmfs snapshot resignature -u 527021ec-3ff82c2b-8f6b-0050560311e9

That's it! We have mounted the snapshot LUN to the ESXi host and it should now be visible to us.

You can verify further by running the below and also carefully notice that the UUID has changed for the newly mounted LUN.

vSphere handle snapshot LUNs

Well, you could also perform this steps all from the vSphere client and also the vSphere Web Client.

While you are going through the Add Storage wizard, at one point you will be presented bu both the options that we saw above.

vSphere handle snapshot LUNs

You will then be able to see the same in the datastore view as seen below.

vSphere handle snapshot LUNs

I hope that this has been informative and thank you for reading!

Share.

About Author

I am Adil Arif, working as a Senior Technical Support Engineer at Rubrik as well as an independent blogger and founder of Enterprise Daddy. In my current role, I am supporting infrastructure related to Windows and VMware datacenters.

Leave A Reply