Untitled
By: a guest | Feb 9th, 2010 | Syntax:
Perl | Size: 1.26 KB | Hits: 18 | Expires: Never
# Verify the volume which we are about to destroy is really what we thing we're destroying
# Volume State Status Options
# xdvums_report online raid_dp, flex create_ucode=on, guarantee=none
# Clone, backed by volume 'xdvums', snapshot 'XDVUMS_report'
# Containing aggregate: 't2gen1000'
my $cmd = "vol status $flexClone";
my @output = &$rshCmd($filer, $cmd);
my $goodFlag = 0;
foreach my $line (@output)
{
$goodFlag = 1 if($line =~ m/\s+Clone, backed by volume '$srcVol', snapshot '$snapName'/);
$goodFlag = 1 if($line =~ m/\s*vol status: No volume named/);
}
if($goodFlag == 1)
{
$cmd = "vol offline $flexClone";
@output = &$rshCmd($filer, $cmd);
$cmd = "vol destroy $flexClone -f";
@output = &$rshCmd($filer, $cmd);
} else {
bail
($node->getAttribute("name"), "destroy", sprintf("Request to destroy volume, %s, which is not based on the expected parent volume or snapshot.", $flexClone));
}