Skip to content

Instantly share code, notes, and snippets.

@patrobinson
Last active August 29, 2015 14:02
Show Gist options
  • Save patrobinson/2a851db33c41380952da to your computer and use it in GitHub Desktop.
Save patrobinson/2a851db33c41380952da to your computer and use it in GitHub Desktop.
my $datastoreSystem = Vim::get_view(mo_ref => $host->configManager->datastoreSystem);
my @unbound = $datastoreSystem->QueryUnresolvedVmfsVolumes();
foreach my $dstore (@unbound) {
my $volume = ${$dstore}[0];
if($volume->{'vmfsLabel'} ne $vmfsLabel) {
print "Unresolved VMFS volume ".$volume->{'vmfsLabel'}." found but does not match ".$vmfsLabel."\n";
next;
}
my @extpaths;
my $extents = $volume->{'extent'};
foreach my $ex (@$extents) {
push @extpaths, $ex->devicePath;
}
my $res = HostUnresolvedVmfsResignatureSpec->new(
extentDevicePath => \@extpaths
);
$datastoreSystem->ResignatureUnresolvedVmfsVolume(resolutionSpec => $res);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment