|
|
Suppose you want to move a disk D from resource group A to resource group B (in different region possibly), then you can:
|
|
|
- Create a snapshot of the disk A, named SA
|
|
|
- Move SA from subscription A to B (easy from the subscription card in the azure dashboard)
|
|
|
- Create a storage account in B from the dashboard (not needed if already created, now there is **dsipstorageaccount** account)
|
|
|
- Create a container in the storage account![Schermata_del_2021-04-22_10-43-44](uploads/dadabf91b0e8fec7c29f8a0856e6115e/Schermata_del_2021-04-22_10-43-44.png)
|
|
|
- Create a **blob** storage in the container
|
|
|
![Schermata_del_2021-04-22_10-43-55](uploads/3e43fe97a44d52c38ffe4f64f3616a4c/Schermata_del_2021-04-22_10-43-55.png)
|
|
|
- Run the powershell script attached modifiyng the parameters in source and destination
|
|
|
- Create a disk from the dashboard starting from the blob storage (pay attention to the zone!)
|
|
|
![Schermata_del_2021-04-22_10-45-58](uploads/c47976a6d0bf183a4644834d3600d81e/Schermata_del_2021-04-22_10-45-58.png)
|
|
|
- Go to the VM disk managment **refresh** and **attach an existing disk** from the **blob storage**
|
|
|
![Schermata_del_2021-04-22_10-47-16](uploads/818e0b0c789d8b2fecb62b91151db9aa/Schermata_del_2021-04-22_10-47-16.png)
|
|
|
- Mount the disck (WITHOUT FORMATTING!) using the steps described here:
|
|
|
- find the disk `lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"` SUPPOSE **sdc1**
|
|
|
- create the mount and mount the disk `sudo mkdir /datadrive` `sudo mount /dev/sdc1 /datadrive`
|
|
|
- make the mount permanent:
|
|
|
- `sudo blkid`
|
|
|
- copy the UUID relative to sdc1
|
|
|
- edit fstab `sudo nano /etc/fstab` and add something like that `UUID=f603f1e2-bd80-4d0c-ab52-524c44069f02 /ada2 ext4 defaults,discard 0 0
|
|
|
`
|
|
|
|
|
|
[powershell_script](uploads/7b2c4a2d16b5bbdb635187e005e55be9/powershell_script)
|
|
|
|
|
|
REFERENCES
|
|
|
|
|
|
[https://lepczynski.it/en/azure_en/how-to-move-a-vm-disk-snapshot-to-another-region/]
|
|
|
|
|
|
[https://docs.microsoft.com/en-us/azure/virtual-machines/linux/attach-disk-portal] |
|
|
\ No newline at end of file |