Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.18k stars 3.79k forks source link

[Feature]: Enable support for Importing TrustedLaunch/VM Guest State VHDs #25077

Open ld0614 opened 2 months ago

ld0614 commented 2 months ago

Description of the new feature

Basically the request is to have feature parity with the AZ CLI which introduced a similar change 2 years ago (Scenario 2) https://github.com/Azure/azure-cli/issues/22275

I would like to be able to export a TrustedLaunch VM and then be able to import the VM again. Our use case is for (cheap) long term archival of decommissioned VMs (some have to be kept around for 10 or so years in case there is a legal dispute or financial auditing etc)

With the latest release of Az.Compute it looks like we can export the VM Guest State VHD so the only missing feature is now the ability to import the Guest State as part of the OS Disk creation.

I am currently having to do this through the AZ CLI as it doesn't appear that New-AzDiskConfig or New-AzDisk offer the parameters equivalent to --security-data-uri and --security-type $OSDiskImport = az disk create --name $OSDiskName --resource-group $ResourceGroupName --sku "StandardSSD_LRS" --location $Location --source $OSDiskUri --source-storage-account-id $StorageAccount.Id --security-data-uri $VMStateDiskUri --security-type TrustedLaunch --hyper-v-generation V2 --os-type Windows

Proposed implementation details (optional)

In my mind the easiest approach would be to copy the AZ CLI parameters with more PowerShell like names such as -SecurityDataUri and -SecurityType which has an enum with Trustedlaunch and Standard if Confidential computing types aren't going to be supported

I would assume that these map back to existing REST APIs/Interfaces if the AZ CLI is already using them

microsoft-github-policy-service[bot] commented 2 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @TravisCragg-MSFT, @nikhilpatel909, @sandeepraichura, @hilaryw29, @GabstaMSFT, @ramankumarlive, @ushnaarshadkhan.

TravisCragg-MSFT commented 2 months ago

Thanks for the feedback! We are triaging this issue and will update as soon as we can.