Software Development Kit (SDK) and API Discussions
Software Development Kit (SDK) and API Discussions
Hello, I have been trying to find a way to test if a clone split is complete. I know Get-NcCloneSplitStatus gives me information but throws an error after the clone is complete. I looked at the volume fields on the cli and there is field called clone-volume, but could not find the corresponding PS attribute. I ended up doing something like below but wanted to know if there is a better way code wise to test to see if the clone split was done.
$snap_busy = (Get-NcVol -Vserver $svm -name $org_vol | Get-NcSnapshot -SnapName $org_snap).Dependency
while($snap_busy)
{
Write-Host "Wakeup in 30 seconds...."
Start-Sleep 30
$snap_busy = (Get-NcVol -Vserver $svm -name $org_vol | Get-NcSnapshot -SnapName $org_snap).Dependency
}
Solved! See The Solution
Same logic as your code, but once the split operation has been completed, the volume will no longer show up in the output of the "Get-NcVolClone" command (since it is no longer a clone). In your code, you could test for its absence from the output of that command and then branch from there based on that data.
$SplitStatus = Get-NcVolClone -Volume volume01
while ($SplitStatus){
Write-Host "Split in progress..."
Start-Sleep 30
$SplitStatus = Get-NcVolClone -Volume volume01
}
Same logic as your code, but once the split operation has been completed, the volume will no longer show up in the output of the "Get-NcVolClone" command (since it is no longer a clone). In your code, you could test for its absence from the output of that command and then branch from there based on that data.
$SplitStatus = Get-NcVolClone -Volume volume01
while ($SplitStatus){
Write-Host "Split in progress..."
Start-Sleep 30
$SplitStatus = Get-NcVolClone -Volume volume01
}
Excellent I ran the code with this and it worked great and cleaner option. Thanks for the solution.