LINUX開機失敗 將OS磁碟掛到另外一台虛擬機器進行修改
1.建立OS磁碟快照
footer
See also :
https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshoot-recovery-disks-portal-linux
- Stop the affected VM.
- Take a snapshot for the OS disk of the VM.
- Create a virtual hard disk from the snapshot.
- Attach and mount the virtual hard disk to another Windows VM for troubleshooting purposes.
- Connect to the troubleshooting VM. Edit files or run any tools to fix issues on the original virtual hard disk.
- Unmount and detach the virtual hard disk from the troubleshooting VM.
- Swap the OS disk for the VM
2.建立磁碟
使用cloud powershell進行
#Provide the name of your resource group
$resourceGroupName ='Owncloud'
#Provide the name of the snapshot that will be used to create Managed Disks
$snapshotName = 'pccoc02-snapshot'
#Provide the name of theManaged Disk
$diskName = 'newpccoc02OSDisk'
#Provide the size of the disks in GB. It should be greater than the VHD file size. In this sample, the size of the snapshot is 127 GB. So we set the disk size to 128 GB.
$diskSize = '128'
#Provide the storage type for Managed Disk. Premium_LRS or Standard_LRS.
$storageType = 'Standard_LRS'
#Provide the Azure region (e.g. westus) where Managed Disks will be located.
#This location should be same as the snapshot location
#Get all the Azure location using command below:
#Get-AzLocation
$location = 'Southeast Asia'
$snapshot = Get-AzSnapshot -ResourceGroupName $resourceGroupName -SnapshotName $snapshotName
$diskConfig = New-AzDiskConfig -AccountType $storageType -Location $location -CreateOption Copy -SourceResourceId $snapshot.Id
New-AzDisk -Disk $diskConfig -ResourceGroupName $resourceGroupName -DiskName $diskName
3.掛接磁碟到其他VM並進行修改
4.完成修改後 de-attach disk
5.swap OS disk
https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshoot-recovery-disks-portal-linux
留言