Monday, November 05, 2012

How to force to mount a datastore with vSphere without resignature


It describes how a datastore can be mounted and unmounted, while not changing its UUID. This has to be done e.g. if a LUN is discovered as snapshot LUN by the ESX host. In the SAN guide published by VMware this is also mentioned in page 74:
1. Log in to the vSphere Client and select the server from the inventory panel.
2. Click the Configuration tab and click Storage in the Hardware panel.
3. Click Add Storage.
4. Select the Disk/LUN storage type and click Next.
5. From the list of LUNs, select the LUN that has a datastore name displayed in the VMFS Label column and
click Next.
The name present in the VMFS Label column indicates that the LUN is a copy that contains a copy of an
existing VMFS datastore.
6. Under Mount Options, select Keep Existing Signature.
7. In the Ready to Complete page, review the datastore configuration information and click Finish.
But there are some pitfalls: If a datastore was already mounted by an ESX host inside a cluster, the vCenter is aware of this and hides the datastores in the “Add storage” dialog. Reason:
“When one ESX 4.0 host force mounts a VMFS datastore residing on a LUN which has been detected as a snapshot, an object is added to the datacenter grouping in the vCenter database to represent that datastore. When a second ESX 4.0 host attempts to do the same operation on the same VMFS datastore, the operation fails because an object already exists within the same datacenter grouping in the vCenter database. Since an object already exists, vCenter Server does not allow mounting the datastore on any other ESX host residing in that same datacenter.”
Further it may happen that you have some freespace left on the volume presented by the storage. In this case after the point 6 of the description above you are asked to create a new VMFS datastore (as second partition) or to expand the existing one. There is no other possibility and if you don’t want to do this you can’t complete the wizard.
So you are forced to this as described in the knowledge base article above in workaround B (By connecting directly to the ESX host service console):
1. Log in as root to the ESX host which cannot mount the datastore using an SSH client.
2. Run the command:
esxcfg-volume -l
The results appear similar to:
VMFS3 UUID/label: 4b057ec3-6bd10428-b37c-005056ab552a/ TestDS
Can mount: Yes
Can resignature: Yes
Extent name: naa.6000eb391530aa26000000000000130c:1 range: 0 – 1791 (MB)
Record the UUID portion of the output. In the above example the UUID is 4b057ec3-6bd10428-b37c-005056ab552a.
Note: The Can mount value must be Yes to proceed with this workaround.
3. Run the command:
esxcfg-volume -M
Where the is the value recorded in step 3.
Note: If you do not wish the volume mount to persist a reboot, the -m switch can be used instead.
Example2:
To mount the VMFS volume on each of the other ESX/ESXi hosts, use one of these options:
  1. By connecting to the ESX host with vSphere Client:
    1. Connect vSphere Client directly to the second ESX host as root.
    2. Click the Configuration tab.
    3. Click Storage.
    4. Click Add Storage....
    5. Complete the wizard to force mount the appropriate VMFS volume which is being detected as a Snapshot LUN.
       
  2. By connecting directly to the ESX host service console:
    1. Log in as root to the ESX host which cannot mount the datastore using an SSH client. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807).
      Note: All of the commands listed are available in ESXi via the vSphere CLI.
    2. Run the command:

      # esxcfg-volume -l
      The results appear similar to:


      VMFS3 UUID/label: 4b057ec3-6bd10428-b37c-005056ab552a/ TestDS
      Can mount: Yes
      Can resignature: Yes
      Extent name: naa.6000eb391530aa26000000000000130c:1 range: 0 - 1791 (MB)
      Record the UUID portion of the output. In the above example the UUID is 4b057ec3-6bd10428-b37c-005056ab552a.
      Note: The Can mount value must be Yes to proceed with this workaround.
      Note: The esxcfg-volume command has been depreciated in ESXi 5.0 in favor of the esxclicommand. For more/related information, see vSphere handling of LUNs detected as snapshot (1011387).
       
    3. Run the command:

      # esxcfg-volume -M
      Where the  is the value recorded in step 3.

      Note: If you do not wish the volume mount to persist across a reboot, the -m switch can be used instead.
       
  3. By relocating the ESX hosts within the vCenter. Alternatively, you can move each ESX host to its own datacenter before starting the Add Storage operation.
    Warning: This option may be disruptive in a production environment, especially if there are more than two hosts in the same datacenter.

Note: To view the datastores again in vCenter Server, you may have to perform a rescan of the storage adapters on all ESX/ESXi hosts that the datastore is presented to or a refresh of the storage view.

No comments:

Post a Comment

acm bottom ad