Forum Discussion
- cmautnerPuritanGUID conflict it sounds like, are you able to see it in DiskPart? If so you can resignature it. You may need to put it on an intermediary server just to perform the resignature and place is back to the original. I will post the diskpart commands here tomorrow when I am back at my desk.
- cmautnerPuritanfwiw, if you are doing a refresh to a downstream server via automation, it’s always worth resignaturing so you can always bring up multiple copies without issue/conflict.
- cmautnerPuritanIf you were doing it programmatically, here is the local Powershell Call… You can also invoke $diskpart to a remote computer as part of a script block in the Invoke-Command if you are quarterbacking from a centralized server ```$diskSerial = "XYZ123" Get-Disk | Where-Object { $_.serialnumber -eq $diskSerial } $guid = [GUID]::NewGuid() $disknumber = $targetDisk.DiskNumber $cmds = "`"SELECT DISK $disknumber`"", "`"attributes disk clear readonly`"", "`"UNIQUEID DISK ID=$guid`"" $scriptblock = [string]::Join(",", $cmds) $diskpart = $ExecutionContext.InvokeCommand.NewScriptBlock("$scriptblock | DISKPART") $DiskOpResult = Invoke-Expression ($diskpart.ToString())```
- cmautnerPuritanYes, and I actually, as a matter of habit, offline and re-online prior to mounting and just after mounting as well….. Just from creating custom solutions in many different customer environments as part of Professional Services, every environment behaves differently. This is the most blanket/reliable process I have found. ``` $targetDisk = Get-Disk | Where-Object { $_.serialnumber -eq $diskSerial } Set-Disk -Number $targetDisk.number -IsOffline $true Start-Sleep 2 Set-Disk -Number $targetDisk.number -IsOffline $false Start-Sleep 2 $Partition = Get-Partition -DiskNumber $targetDisk.Number | Where-Object { $_.type -eq 'Basic' } Add-PartitionAccessPath -PartitionNumber $Partition.PartitionNumber -DiskNumber $targetDisk.Number -AccessPath $osMountPath Set-Disk -Number $targetDisk.number -IsOffline $true Start-Sleep 2 Set-Disk -Number $targetDisk.number -IsOffline $false Start-Sleep 2```
- bradn2k1Novice Iyes i'm able to see it in Diskpart
- cmautnerPuritanThis Q&A, although for Windows 10, is describing what I think the issue is, and the solution. https://superuser.com/questions/1712898/how-can-i-change-the-disk-id-of-a-freshly-cloned-disk
- bradn2k1Novice Icmautner - how would you retrieve the current $diskSerial or $diskSerial for current drive letter? We are migrating from a NetApp san to PureArray, NetApp san utilize drive letter not serialnumber.
- cmautnerPuritanIf you are using PowerShellSDK or the API when cloning the disk, the SN of the new disk is returned…. You wouldn’t want to use the current letter, because its not yet mounted and the serial number of the copy will be different than the origional.
- cmautnerPuritanSo for $tgtVolObj = New-PfaVolume -Array $objtargetArray -VolumeName $targetVolName -Source $ourPGSnapVol.name -Overwrite $tgtVolObj.serial is what you are looking for
- bradn2k1Novice Icmautner is there a powershell command to online / offline the drive. Would this be sufficient for the SDK2?