@Infra Leads Thanks for reaching out to Microsoft Q&A. I understand that you want to encrypt disks in your Azure Linux VM(Cent OS7).
Here are the steps for Encrypting an OS drive on a running Linux VM- https://learn.microsoft.com/en-us/azure/virtual-machines/linux/disk-encryption-sample-scripts#steps
Steps
- Create a VM by using one of the distributions specified previously. For CentOS 7.2, OS disk encryption is supported via a special image. To use this image, specify "7.2n" as the SKU when you create the VM: PowerShellCopy
Set-AzVMSourceImage -VM $VirtualMachine -PublisherName "OpenLogic" -Offer "CentOS" -Skus "7.2n" -Version "latest"
```
1. Configure the VM according to your needs. If you're going to encrypt all the (OS + data) drives, the data drives need to be specified and mountable from /etc/fstab.
**Note**
Use UUID=... to specify data drives in /etc/fstab instead of specifying the block device name (for example, /dev/sdb1). During encryption, the order of drives changes on the VM. If your VM relies on a specific order of block devices, it will fail to mount them after encryption.
1. Sign out of the SSH sessions.
1. To encrypt the OS, specify volumeType as **All** or **OS** when you enable encryption.
**Note**
All user-space processes that are not running as `systemd` services should be killed with a `SIGKILL`. Reboot the VM. When you enable OS disk encryption on a running VM, plan on VM downtime.
1. Periodically monitor the progress of encryption by using the instructions in the [next section](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/disk-encryption-sample-scripts#monitoring-os-encryption-progress).
1. After Get-AzVmDiskEncryptionStatus shows "VMRestartPending", restart your VM either by signing in to it or by using the portal, PowerShell, or CLI.
PowerShellCopy
C:\> Get-AzVmDiskEncryptionStatus -ResourceGroupName $ResourceGroupName -VMName $VMName
-ExtensionName $ExtensionName
OsVolumeEncrypted : VMRestartPending DataVolumesEncrypted : NotMounted OsVolumeEncryptionSettings : Microsoft.Azure.Management.Compute.Models.DiskEncryptionSettings ProgressMessage : OS disk successfully encrypted, reboot the VM ```
Before you reboot, we recommend that you save [boot diagnostics](https://azure.microsoft.com/blog/boot-diagnostics-for-virtual-machines-v2/) of the VM.
Does this help with your concern? If not, please do let me know and I will be glad to assist further. Thank you!
Remember:
Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
Want a reminder to come back and check responses? Here is how to subscribe to a notification.