Sfoglia il codice sorgente

Ignore invalid disks in `bring-disks-online.ps1` script

Some removable disks will fail to set themselves as read-write. This patch
makes sure to silently ignore those and continue with the execution of the
script, also making sure that the cloudbase-init runs successfully
post-migration.
Daniel Vincze 10 mesi fa
parent
commit
4e89615809
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      coriolis/resources/bin/bring-disks-online.ps1

+ 2 - 2
coriolis/resources/bin/bring-disks-online.ps1

@@ -97,8 +97,8 @@ function Invoke-Main {
     foreach($dsk in $disks) {
     foreach($dsk in $disks) {
         Get-DiskDetails $dsk | Set-DiskOnline | Import-ForeignDisk | Out-Null
         Get-DiskDetails $dsk | Set-DiskOnline | Import-ForeignDisk | Out-Null
     }
     }
-    Get-Disk | Set-Disk -IsOffline:$false
-    Get-Disk | Where-Object {$_.IsBoot -eq $false} | Set-Disk -IsReadOnly:$false
+    Get-Disk | Set-Disk -IsOffline:$false -ErrorAction 'SilentlyContinue'
+    Get-Disk | Where-Object {$_.IsBoot -eq $false} | Set-Disk -IsReadOnly:$false -ErrorAction 'SilentlyContinue'
 }
 }
 
 
 Invoke-Main
 Invoke-Main