Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
In powershell what is a good way to test to see if a clone split is complete?
2021-04-05
10:32 AM
1,906 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
1 ACCEPTED SOLUTION
aleeyee has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
}
2 REPLIES 2
aleeyee has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Excellent I ran the code with this and it worked great and cleaner option. Thanks for the solution.
