Last active
August 29, 2015 14:02
-
-
Save patrobinson/4f57c61a497c117bd681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@unbound_volumes = host.configManager.datastoreSystem.QueryUnresolvedVmfsVolumes | |
fail "No unresolved VMFS volumes found" if @unbound_volumes.empty? | |
@volume = nil | |
@unbound_volumes.each do |dstore| | |
next unless dstore.is_a? RbVmomi::VIM::HostUnresolvedVmfsVolume | |
# Unless this volume matches our vmfsLabel skip it | |
next unless dstore.vmfsLabel == vmfsLabel | |
@extpaths = [] | |
dstore.extent.each { |ex| @extpaths.push ex.devicePath } | |
# Build a spec to find our volume | |
@res_spec = RbVmomi::VIM::HostUnresolvedVmfsResignatureSpec.new(:extentDevicePath => @extpaths) | |
# Resignature our volume's VMFS ID so it's unique | |
host.configManager.datastoreSystem.ResignatureUnresolvedVmfsVolume_Task(:resolutionSpec => @res_spec ).wait_for_completion | |
@volume = dstore | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment