1 2 3 Previous Next 32 Replies Latest reply on Apr 4, 2013 12:57 PM by bsti Go to original post
      • 15. Re: Enable Mount and resignature of  snap luns on vSphere
        Karth Lurker

        Hi,

         

        Can you share the steps you did to Mount the VMFS with the same signature?

         

        Thanks

        Karthick

        • 16. Re: Enable Mount and resignature of  snap luns on vSphere
          tonygent Enthusiast

          Hi - Sorry for the late reply (and even this is going to be a bit fast I'm afraid).

          Firstly - I've not done the completion work on this - It's been handled by another guy in the team, but I thought I'd catch you up with the resolution.

           

          Firstly - the VMware 3 model was to NOT mount or re-signature (rename) DataStores that were possibly snaps presented from your storage. Mounting two DataStores of the same name can cause issues with VM's mounting disks from the wrong store. In my environment, if I wanted to snap and present a historic copy of a DataStore from my SAN, I'd need to change the LVM>DisAllowSnap and AllowResig values on the host before the snapped DataStore would be visible.

          I'd scripted this process with PowerShell and all was good. We'd enable the settings on each host - mount the LUNs, rescan to resig the DataStores, play with them, then disable the settings, and rescan to remove the LUNs. All good. 

           

          We then upgraded to VSphere.

          With vSphere - the LVM settings mentioned do not work with PowerShell and do not appear in the client interface. In addition - there is a new model, where you can "on a LUN by LUN basis" decide if you want to mount. However - this process within the API still seems broken. This left me with no way of snapping and mounting several historic LUN's with the PowerShell.

           

          In the end - we have had to bypass this issue with a cheat. While the VI Client Interface and PowerShell do not have settings to apply the original "Global - allow all" settings that previously existed. The ESX host still does have this setting. We are able to use the esxcfg command at the service console cli on each ESX host to set the host to allow snaps and allow resig. Once this is set - I can just add the LUN's rescan with the PowerShell and the resig'd LUN's appear. It's an "Always on" setting, but it's better than nothing.

           

          Hopefully that will assist. By all means reply if you need more info.

          • 17. Re: Enable Mount and resignature of  snap luns on vSphere
            Karth Lurker

            Thanks  u so much .It realy helpfull to me

             

            did u use the following command to dothe resignature or some thing else?--  esxcfg-volume -r "Label name" 

             

            The problem is , i am trying to implement the "Force mount" operation in the ESX 4.0 using Vsphere SDK.

            if i get any sample code related to this will be very helpful.

            • 18. Re: Enable Mount and resignature of  snap luns on vSphere
              tonygent Enthusiast

              Hi.

              Re-Signature happens automatically. The DataStore will appear with snap-xxxxxx- where xxxxx is a random set of chars, you don't define the new name yourself..

               

              To enable Resig and try the following from the service console of the ESX host :

               

              Run the following commands:

              1. esxcfg-advcfg --get /LVM/EnableResignature It should be set to 0 - Resignaturing is OFF

               

              2. Now set it to on.

              esxcfg-advcfg -s 1 /LVM/EnableResignature

               

              3. Issue a "refresh" in VI client storage view and the snapshot Luns of the same source LUN get re-signatured simultaneously:

               

              4. Reset the enableResignature option:

              esxcfg-advcfg -s 0 /LVM/EnableResignature

               

              Thanks to Darragh Connolly for assistance with this issue.

               

              Let me know how you get on.

               

              TG

              • 19. Re: Enable Mount and resignature of  snap luns on vSphere
                Master

                Converted to PowerCLI that looks like:

                 

                Get-VMHost | Set-VMHostAdvancedConfiguration -Name LVM.EnableResignature -Value 1
                Get-VMHost | Get-VMHostStorage -RescanAllHBA -RescanAllVMFS
                Get-VMHost | Set-VMHostAdvancedConfiguration -Name LVM.EnableResignature -Value 0
                

                 

                That will do it across all hosts. To do it for a specific host give an argument to Get-VMHost.

                 

                =====

                Carter Shanklin

                Read the PowerCLI Blog
                [Follow me on Twitter|http://twitter.com/cshanklin]

                • 20. Re: Enable Mount and resignature of  snap luns on vSphere
                  tonygent Enthusiast

                  Hi Carter,

                   

                  Thanks for the response, but I think you have come to this a little late. The issue seems to be that the settings you are describing "The Advanced config" settings don't actually appear in vSphere. They DO appear in VI3 and the code you have described worked great in VI3, but in vSphere it seems not to work.

                  I've tested your code (in case you found a new and cool way to fix my issue :od)  and I get the following error when attempting to run against a vSphere host :

                   

                  Set-VMHostAdvancedConfiguration : Item has already been added. Key in dictionary: 'Misc.LogToFile'  Key being added: 'M

                  isc.LogToFile' At C:\Documents and Settings\Administrator.SNS_AD\Desktop\tg_TestADVConfig.ps1:7 char:65

                  + get-vmhost hydra3.SNSLTD.CO.UK | set-VMHostAdvancedConfiguration  <<<< -Name LVM.EnableResignature -value 1

                   

                  If I run the same code against a VI3 server - it works fine. Therefore - at present, I still have to conclude that there seems to be no way of effectively changing the settings for VI4 and as I state on the post (sorry it's a  bit long winded - but there's a lot of info) vSphere does not seem to have a "One settings changes all LUN's" approach as adopted in VI3.

                   

                  Hope this assists anyone else looking into this. I do recommend reading the whole post though as it's a long winded issue

                   

                  TG

                  • 21. Re: Enable Mount and resignature of  snap luns on vSphere
                    Michelle Laverick Virtuoso

                    Hi. Using Oynx to find out the PowerCLI. I came up with this sample code:

                     

                    1. ------- QueryAvailableDisksForVmfs -------

                     

                    $datastore = $null

                     

                    $_this = Get-View -Id 'HostDatastoreSystem-datastoreSystem-25'

                    $_this.QueryAvailableDisksForVmfs($datastore)

                     

                     

                     

                    1. ------- QueryUnresolvedVmfsVolume -------

                     

                    $_this = Get-View -Id 'HostStorageSystem-storageSystem-25'

                    $_this.QueryUnresolvedVmfsVolume()

                     

                     

                     

                    1. ------- RetrieveDiskPartitionInfo -------

                     

                    $devicePath = New-Object System.String[] (1)

                    $devicePath[0] = "/vmfs/devices/disks/naa.6006048cc6c62ffdc29a13bf6bc650de"

                     

                    $_this = Get-View -Id 'HostStorageSystem-storageSystem-25'

                    $_this.RetrieveDiskPartitionInfo($devicePath)

                     

                     

                     

                    1. ------- QueryVmfsDatastoreCreateOptions -------

                     

                    $devicePath = "/vmfs/devices/disks/naa.6006048cc6c62ffdc29a13bf6bc650de"

                     

                    $_this = Get-View -Id 'HostDatastoreSystem-datastoreSystem-25'

                    $_this.QueryVmfsDatastoreCreateOptions($devicePath)

                     

                     

                     

                    1. ------- ResignatureUnresolvedVmfsVolume_Task -------

                     

                    $resolutionSpec = New-Object VMware.Vim.HostUnresolvedVmfsResignatureSpec

                    $resolutionSpec.extentDevicePath = New-Object System.String[] (1)

                    $resolutionSpec.extentDevicePath[0] = "/vmfs/devices/disks/naa.6006048cc6c62ffdc29a13bf6bc650de:1"

                     

                    $_this = Get-View -Id 'HostDatastoreSystem-datastoreSystem-25'

                    $_this.ResignatureUnresolvedVmfsVolume_Task($resolutionSpec)

                     

                     

                    I feel like i"m close. The weird thing is - I originally started out with the esxcfg-volume and vicfg-volume commands to resigniture volumes on a UUID/Label basis. But now when ever I present a new volume it seems to get resignitured automatically...?

                     

                    Regards

                    Mike Laverick

                    RTFM Education

                    http://www.rtfm-ed.co.uk

                    Author of the SRM Book:http://stores.lulu.com/rtfm

                    Free PDF or at-cost Hard Copy

                    http://communities.vmware.com/servlet/JiveServlet/download/1200101-20223/vExpert_logo_100x57.jpg

                    • 22. Re: Enable Mount and resignature of  snap luns on vSphere
                      tristanball Lurker

                       

                      You say you're close? What part of your code doesn't work? It looks like it should to me?

                       

                       

                       

                       

                       

                      My version:

                       

                       

                      ---

                       

                       

                      $hostView = get-vmhost -name "esx1.local.names" | get-view

                      $dsView = get-view $hostView.ConfigManager.DatastoreSystem

                      $unBound = $dsView.QueryUnresolvedVmfsVolumes()

                       

                      foreach ($ub in $UnBound) {

                       

                      $extPaths = @()

                      $Extents = $ub.Extent;
                      foreach ($ex in $Extents) {

                      $extPaths = $extPaths + $ex.DevicePath

                      }
                      $res = New-Object VMware.Vim.HostUnresolvedVmfsResignatureSpec
                      $res.ExtentDevicePath = $extPaths
                      $dsView.ResignatureUnresolvedVmfsVolume($res)

                      }

                       

                       

                       

                       

                      ---

                       

                       

                      This works, but only for VMFS volumes consisting of 1 extent on 1 lun. For some reason I can't resignature a vmfs volume that consists of multiple extents over multiple luns - and the error messages returned are not helpful!

                       

                       

                      • 23. Re: Enable Mount and resignature of  snap luns on vSphere
                        MorDrakka Novice

                        Hi all,

                         

                        I am currently trying to Force Mount a Snaplun WITHOUT resignature. This is a DR lun in another vcenter. I do not wish to resignature because after a couple of hours the replication will be reversed again and the lun will be in the original site and vCenter, then I am able to to poweron the VM's which are still in the source vCenter.

                         

                        This is the way our DR works in another environment which is ESX3.5u4.

                         

                        The only way I am able to do this in vSphere 4.1 is to mount the volume to one ESX, then login in eachother ESX in the cluster and force mount it with the following commands:

                         

                        esxcfg-volume -l

                        esxcfg-volume -M <id>

                         

                        I already played with the SCSI.Comparelunnumber setting that works for us in the other environment, however this does not work(Because of the change in NAA id).

                         

                        Any help is appreciated.

                        • 24. Re: Enable Mount and resignature of  snap luns on vSphere
                          MorDrakka Novice

                          Hi thx to Onyx I resolved it myself:

                           

                          $cluster =
                          $vcenter =
                          $user = "root"
                          $password =
                          Connect-VIServer $vcenter
                          Foreach($esxhost in (Get-VMHost -Location $cluster)){
                              Connect-VIServer $esxhost -User $user -Password $password
                              $hostView = get-vmhost -name $esxhost | get-view
                              $dsView = get-view $hostView.ConfigManager.DatastoreSystem
                              $unBound = $dsView.QueryUnresolvedVmfsVolumes()

                           

                              foreach ($ub in $UnBound) {
                                  $extPaths = @()
                                  $Extents = $ub.Extent;
                                  foreach ($ex in $Extents) {
                                  $extPaths = $extPaths + $ex.DevicePath
                                                            }      
                                  $resolutionSpec = New-Object VMware.Vim.HostUnresolvedVmfsResolutionSpec[] (1)
                                  $resolutionSpec[0] = New-Object VMware.Vim.HostUnresolvedVmfsResolutionSpec
                                  $resolutionSpec[0].extentDevicePath = New-Object System.String[] (1)
                                  $resolutionSpec[0].extentDevicePath[0] = $extPaths
                                  $resolutionSpec[0].uuidResolution = "forceMount"

                           

                              $dsView = Get-View -Id 'HostStorageSystem-storageSystem'
                              $dsView.ResolveMultipleUnresolvedVmfsVolumes($resolutionSpec)
                              }
                          }

                          • 25. Re: Enable Mount and resignature of  snap luns on vSphere
                            avlieshout Expert
                            VMware Employees

                            The esx 3.x advanced setting also still works

                            • 26. Re: Enable Mount and resignature of  snap luns on vSphere
                              habibalby Expert

                              connecting directly to the host using vSphere Client / ViClient, and mount the VMFS with the exisiting signature. It will work. I have just encounter this issue on iSCSI Server  when I try to mount exisiting VMFS that was mounted on our production server. When I shiftted the server to the DR Site, and tried to mount it using vCenter, I got the error host unable to resolve VMFS datastore. I connected directly to the host and mount the VMFS and that works.

                              • 27. Re: Enable Mount and resignature of  snap luns on vSphere
                                mikelleen Novice

                                OK this is a NOOB issue, but  I have been trying to follow the thread above in order tor resolve my own resignature issues.

                                 

                                So, does anyone know why I am getting the following erro, I assume this is a configuration issue with the ESX host?:

                                 

                                PS C:\Documents and Settings\xxxxx> $dsView = get-view $hostView.ConfigManager.DatastoreSystem
                                PS C:\Documents and Settings\xxxxx> echo $dsView


                                Datastore    : {Datastore-datastore-327, Datastore-datastore-328, Datastore-datastore-329, Datastore-datastore-331...}
                                Capabilities : VMware.Vim.HostDatastoreSystemCapabilities
                                LinkedView   :
                                MoRef        : HostDatastoreSystem-datastoreSystem-1243
                                Client       : VMware.Vim.VimClient

                                 

                                PS C:\Documents and Settings\xxxxx> $unBound = $dsView.QueryUnresolvedVmfsVolumes()
                                PS C:\Documents and Settings\xxxxx> echo $unBound


                                Extent          : {4e7a68b4-5553c13d-389c-00215a4f605e}
                                VmfsLabel       : VM-Mike
                                VmfsUuid        : 4e7a68b4-5553c13d-389c-00215a4f605e
                                TotalBlocks     : 50944
                                ResolveStatus   : VMware.Vim.HostUnresolvedVmfsVolumeResolveStatus
                                DynamicType     :
                                DynamicProperty :

                                 

                                PS C:\Documents and Settings\xxxxx> Write-Host $scsi.ConsoleDeviceName
                                /vmfs/devices/disks/naa.6000d310000d02000000000000009a49
                                PS C:\Documents and Settings\xxxxx> $lunpath = $scsi.ConsoleDeviceName
                                PS C:\Documents and Settings\xxxxx> $res = New-Object VMware.Vim.HostUnresolvedVmfsResignatureSpec
                                PS C:\Documents and Settings\xxxxx> $res.ExtentDevicePath = $lunpath
                                PS C:\Documents and Settings\xxxxx> $dsView.ResignatureUnresolvedVmfsVolume($res)

                                Exception calling "ResignatureUnresolvedVmfsVolume" with "1" argument(s): "Cannot change the host configuration."
                                At line:1 char:40
                                + $dsView.ResignatureUnresolvedVmfsVolume <<<< ($res)
                                    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
                                    + FullyQualifiedErrorId : DotNetMethodException

                                PS C:\Documents and Settings\xxxxx>

                                • 28. Re: Enable Mount and resignature of  snap luns on vSphere
                                  mossko Novice

                                  Hey MorDrakka Thanks for your previous code, i used this as a base for the Resignature code I'm attaching below

                                   

                                  A few notes

                                  • To Resignature, you do not need to connect to each ESXi host
                                  • This works on CLARiiON CX4 and ESXi 4.1u1 in a Cluster with vCenter 4.1u1 with PowerCLI 4.1u1

                                   

                                  function lun_find_and_resignature
                                      # This only needs to run on one ESXi host in the cluster
                                      PARAM (
                                          [string]$_esxhost
                                      )

                                      $hostView = get-vmhost -name $_esxhost | get-view
                                      $dsView = get-view $hostView.ConfigManager.DatastoreSystem
                                      $unBound = $dsView.QueryUnresolvedVmfsVolumes()

                                      foreach ($ub in $UnBound) {
                                          $extPaths = @()
                                          $Extents = $ub.Extent;
                                          foreach ($ex in $Extents) {
                                              $extPaths = $extPaths + $ex.DevicePath
                                          }

                                          $resolutionSpec = New-Object VMware.Vim.HostUnresolvedVmfsResignatureSpec
                                          $resolutionSpec.extentDevicePath = New-Object System.String[] (1)
                                          $resolutionSpec.extentDevicePath[0] = $extPaths

                                          $dsResig = Get-View -Id $hostView.ConfigManager.DatastoreSystem
                                          #$dsResig.ResignatureUnresolvedVmfsVolume_Task($resolutionSpec)    # This one runs a background task and continues
                                          $dsResig.ResignatureUnresolvedVmfsVolume($resolutionSpec)        # This one waits for the task to finish
                                      }

                                  }

                                  • 29. Re: Enable Mount and resignature of  snap luns on vSphere
                                    patsrik Lurker

                                    HI,

                                    What about NFS Volumes. Are there vi java api available to query Unresolved NFS volumes ?? Am using Netapp storage network that has NFS volumes