From 8916d48b6de9670fc146db53a2d5b36cca5ad20e Mon Sep 17 00:00:00 2001 From: Yan Zhu <105691024+yanzhudd@users.noreply.github.com> Date: Thu, 28 Jul 2022 11:45:12 +0800 Subject: [PATCH] [Compute] `az vm disk detach`: Add parameter `--force-detach` to support force-detaching managed data disks from a VM (#23346) --- .../azure/cli/command_modules/vm/_help.py | 3 + .../azure/cli/command_modules/vm/_params.py | 1 + .../azure/cli/command_modules/vm/commands.py | 4 +- .../azure/cli/command_modules/vm/custom.py | 30 +- .../test_custom_vm_commands.py | 4 +- .../test_custom_vm_commands.py | 4 +- .../test_custom_vm_commands.py | 4 +- .../recordings/test_vm_disk_force_detach.yaml | 3435 +++++++++++++++++ .../tests/latest/test_custom_vm_commands.py | 4 +- .../vm/tests/latest/test_vm_commands.py | 63 + 10 files changed, 3540 insertions(+), 12 deletions(-) create mode 100644 src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_disk_force_detach.yaml diff --git a/src/azure-cli/azure/cli/command_modules/vm/_help.py b/src/azure-cli/azure/cli/command_modules/vm/_help.py index 9757f67128e..c1cb2fdf1be 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_help.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_help.py @@ -1821,6 +1821,9 @@ - name: Detach a data disk from a VM. text: > az vm disk detach -g MyResourceGroup --vm-name MyVm --name disk_name + - name: Force detach a data disk from a VM. + text: > + az vm disk detach -g MyResourceGroup --vm-name MyVm --name disk_name --force-detach """ helps['vm encryption'] = """ diff --git a/src/azure-cli/azure/cli/command_modules/vm/_params.py b/src/azure-cli/azure/cli/command_modules/vm/_params.py index 672c12a537f..8d0e8793c02 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_params.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_params.py @@ -504,6 +504,7 @@ def load_arguments(self, _): with self.argument_context('vm disk detach') as c: c.argument('disk_name', arg_type=name_arg_type, help='The data disk name.') + c.argument('force_detach', action='store_true', min_api='2020-12-01', help='Force detach managed data disks from a VM.') with self.argument_context('vm encryption enable') as c: c.argument('encrypt_format_all', action='store_true', help='Encrypts-formats data disks instead of encrypting them. Encrypt-formatting is a lot faster than in-place encryption but wipes out the partition getting encrypt-formatted. (Only supported for Linux virtual machines.)') diff --git a/src/azure-cli/azure/cli/command_modules/vm/commands.py b/src/azure-cli/azure/cli/command_modules/vm/commands.py index f4d66a5ca35..450f9c26fbb 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/commands.py @@ -388,7 +388,7 @@ def load_command_table(self, _): with self.command_group('vm disk', compute_vm_sdk, min_api='2017-03-30') as g: g.custom_command('attach', 'attach_managed_data_disk', validator=process_vm_disk_attach_namespace) - g.custom_command('detach', 'detach_data_disk') + g.custom_command('detach', 'detach_managed_data_disk') with self.command_group('vm encryption', custom_command_type=compute_disk_encryption_custom) as g: g.custom_command('enable', 'encrypt_vm', validator=process_disk_encryption_namespace) @@ -446,7 +446,7 @@ def load_command_table(self, _): with self.command_group('vm unmanaged-disk', compute_vm_sdk) as g: g.custom_command('attach', 'attach_unmanaged_data_disk') - g.custom_command('detach', 'detach_data_disk') + g.custom_command('detach', 'detach_unmanaged_data_disk') g.custom_command('list', 'list_unmanaged_disks') with self.command_group('vm user', compute_vm_sdk, supports_no_wait=True) as g: diff --git a/src/azure-cli/azure/cli/command_modules/vm/custom.py b/src/azure-cli/azure/cli/command_modules/vm/custom.py index e09b58ae596..d8da1b2ed17 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/custom.py +++ b/src/azure-cli/azure/cli/command_modules/vm/custom.py @@ -1916,8 +1916,8 @@ def attach_managed_data_disk(cmd, resource_group_name, vm_name, disk=None, ids=N set_vm(cmd, vm) -def detach_data_disk(cmd, resource_group_name, vm_name, disk_name): - # here we handle both unmanaged or managed disk +def detach_unmanaged_data_disk(cmd, resource_group_name, vm_name, disk_name): + # here we handle unmanaged disk vm = get_vm_to_update(cmd, resource_group_name, vm_name) # pylint: disable=no-member leftovers = [d for d in vm.storage_profile.data_disks if d.name.lower() != disk_name.lower()] @@ -1928,6 +1928,32 @@ def detach_data_disk(cmd, resource_group_name, vm_name, disk_name): # endregion +def detach_managed_data_disk(cmd, resource_group_name, vm_name, disk_name, force_detach=None): + # here we handle managed disk + vm = get_vm_to_update(cmd, resource_group_name, vm_name) + if not force_detach: + # pylint: disable=no-member + leftovers = [d for d in vm.storage_profile.data_disks if d.name.lower() != disk_name.lower()] + if len(vm.storage_profile.data_disks) == len(leftovers): + raise ResourceNotFoundError("No disk with the name '{}' was found".format(disk_name)) + else: + DiskDetachOptionTypes = cmd.get_models('DiskDetachOptionTypes', resource_type=ResourceType.MGMT_COMPUTE, + operation_group='virtual_machines') + leftovers = vm.storage_profile.data_disks + is_contains = False + for d in leftovers: + if d.name.lower() == disk_name.lower(): + d.to_be_detached = True + d.detach_option = DiskDetachOptionTypes.FORCE_DETACH + is_contains = True + break + if not is_contains: + raise ResourceNotFoundError("No disk with the name '{}' was found".format(disk_name)) + vm.storage_profile.data_disks = leftovers + set_vm(cmd, vm) +# endregion + + # region VirtualMachines Extensions def list_extensions(cmd, resource_group_name, vm_name): vm = get_vm(cmd, resource_group_name, vm_name) diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_custom_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_custom_vm_commands.py index f2b2005af40..031ab99d46d 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_custom_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_custom_vm_commands.py @@ -16,7 +16,7 @@ _get_extension_instance_name, get_boot_log) from azure.cli.command_modules.vm.custom import \ - (attach_unmanaged_data_disk, detach_data_disk, get_vmss_instance_view) + (attach_unmanaged_data_disk, detach_unmanaged_data_disk, get_vmss_instance_view) from azure.cli.core import AzCommandsLoader from azure.cli.core.commands import AzCliCommand @@ -206,7 +206,7 @@ def test_deattach_disk_on_vm(self, mock_vm_set, mock_vm_get_to_update): mock_vm_get_to_update.return_value = vm # execute - detach_data_disk(cmd, 'rg1', 'vm1', 'd1') + detach_unmanaged_data_disk(cmd, 'rg1', 'vm1', 'd1') # assert self.assertTrue(mock_vm_get_to_update.called) diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_custom_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_custom_vm_commands.py index f2b2005af40..031ab99d46d 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_custom_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_custom_vm_commands.py @@ -16,7 +16,7 @@ _get_extension_instance_name, get_boot_log) from azure.cli.command_modules.vm.custom import \ - (attach_unmanaged_data_disk, detach_data_disk, get_vmss_instance_view) + (attach_unmanaged_data_disk, detach_unmanaged_data_disk, get_vmss_instance_view) from azure.cli.core import AzCommandsLoader from azure.cli.core.commands import AzCliCommand @@ -206,7 +206,7 @@ def test_deattach_disk_on_vm(self, mock_vm_set, mock_vm_get_to_update): mock_vm_get_to_update.return_value = vm # execute - detach_data_disk(cmd, 'rg1', 'vm1', 'd1') + detach_unmanaged_data_disk(cmd, 'rg1', 'vm1', 'd1') # assert self.assertTrue(mock_vm_get_to_update.called) diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_custom_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_custom_vm_commands.py index c6da87fd631..16c8d7026d7 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_custom_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_custom_vm_commands.py @@ -16,7 +16,7 @@ _get_extension_instance_name, get_boot_log) from azure.cli.command_modules.vm.custom import \ - (attach_unmanaged_data_disk, detach_data_disk, get_vmss_instance_view) + (attach_unmanaged_data_disk, detach_unmanaged_data_disk, get_vmss_instance_view) from azure.cli.core import AzCommandsLoader from azure.cli.core.commands import AzCliCommand @@ -218,7 +218,7 @@ def test_deattach_disk_on_vm(self, mock_vm_set, mock_vm_get_to_update): mock_vm_get_to_update.return_value = vm # execute - detach_data_disk(cmd, 'rg1', 'vm1', 'd1') + detach_unmanaged_data_disk(cmd, 'rg1', 'vm1', 'd1') # assert self.assertTrue(mock_vm_get_to_update.called) diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_disk_force_detach.yaml b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_disk_force_detach.yaml new file mode 100644 index 00000000000..0704713399b --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_disk_force_detach.yaml @@ -0,0 +1,3435 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.26.0 + method: GET + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + response: + body: + string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {},\n \"variables\": + {},\n \"resources\": [],\n \"outputs\": {\n \"aliases\": {\n \"type\": + \"object\",\n \"value\": {\n \"Linux\": {\n \"CentOS\": + {\n \"publisher\": \"OpenLogic\",\n \"offer\": \"CentOS\",\n + \ \"sku\": \"7.5\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Debian\": {\n \"publisher\": + \"Debian\",\n \"offer\": \"debian-10\",\n \"sku\": \"10\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Flatcar\": {\n \"publisher\": \"kinvolk\",\n + \ \"offer\": \"flatcar-container-linux-free\",\n \"sku\": + \"stable\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"openSUSE-Leap\": {\n \"publisher\": + \"SUSE\",\n \"offer\": \"opensuse-leap-15-3\",\n \"sku\": + \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"RHEL\": {\n \"publisher\": \"RedHat\",\n + \ \"offer\": \"RHEL\",\n \"sku\": \"7-LVM\",\n \"version\": + \"latest\",\n \"architecture\": \"x64\"\n },\n \"SLES\": + {\n \"publisher\": \"SUSE\",\n \"offer\": \"sles-15-sp3\",\n + \ \"sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"UbuntuLTS\": {\n \"publisher\": + \"Canonical\",\n \"offer\": \"UbuntuServer\",\n \"sku\": + \"18.04-LTS\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n }\n },\n \"Windows\": {\n \"Win2022Datacenter\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2022-Datacenter\",\n \"version\": + \"latest\",\n \"architecture\": \"x64\"\n },\n \"Win2022AzureEditionCore\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2022-datacenter-azure-edition-core\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Win2019Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2019-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2016Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2016-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2012R2Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-R2-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2012Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2008R2SP1\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2008-R2-SP1\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n }\n }\n }\n }\n }\n}" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - keep-alive + content-length: + - '3463' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:14:43 GMT + etag: + - W/"41b202f4dc5098d126019dc00721a4c5e30df0c5196794514fadc3710ee2a5cb" + expires: + - Wed, 27 Jul 2022 10:19:43 GMT + source-age: + - '0' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding,Origin + via: + - 1.1 varnish + x-cache: + - HIT + x-cache-hits: + - '1' + x-content-type-options: + - nosniff + x-fastly-request-id: + - c75ced5096b66b9371517fa5d6ccb8a9fb96d33a + x-frame-options: + - deny + x-github-request-id: + - DA58:11FF:66E8C:870C1:62E10A36 + x-served-by: + - cache-tyo11932-TYO + x-timer: + - S1658916883.327592,VS0,VE171 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g --location -n --admin-username --image --admin-password --authentication-type + --nsg-rule + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/OpenLogic/artifacttypes/vmimage/offers/CentOS/skus/7.5/versions?$top=1&$orderby=name%20desc&api-version=2022-03-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"7.5.201808150\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/westus/Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.5/Versions/7.5.201808150\"\r\n + \ }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '270' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:14:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15999,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43999 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g --location -n --admin-username --image --admin-password --authentication-type + --nsg-rule + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/OpenLogic/artifacttypes/vmimage/offers/CentOS/skus/7.5/versions/7.5.201808150?api-version=2022-03-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n \"disallowed\": {\r\n + \ \"vmDiskType\": \"None\"\r\n },\r\n \"automaticOSUpgradeProperties\": + {\r\n \"automaticOSUpgradeSupported\": true\r\n },\r\n \"imageDeprecationStatus\": + {\r\n \"imageState\": \"Active\"\r\n },\r\n \"osDiskImage\": {\r\n + \ \"operatingSystem\": \"Linux\",\r\n \"sizeInGb\": 30,\r\n \"sizeInBytes\": + 32212255232\r\n },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": + \"westus\",\r\n \"name\": \"7.5.201808150\",\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/westus/Publishers/OpenLogic/ArtifactTypes/VMImage/Offers/CentOS/Skus/7.5/Versions/7.5.201808150\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '737' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:14:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12999,Microsoft.Compute/GetVMImageFromLocation30Min;73999 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g --location -n --admin-username --image --admin-password --authentication-type + --nsg-rule + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/virtualNetworks?api-version=2018-01-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:14:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"adminPassword": {"type": "securestring", + "metadata": {"description": "Secure adminPassword"}}}, "variables": {}, "resources": + [{"name": "vm-diskforcedetach-testVNET", "type": "Microsoft.Network/virtualNetworks", + "location": "westus", "apiVersion": "2015-06-15", "dependsOn": [], "tags": {}, + "properties": {"addressSpace": {"addressPrefixes": ["10.0.0.0/16"]}, "subnets": + [{"name": "vm-diskforcedetach-testSubnet", "properties": {"addressPrefix": "10.0.0.0/24"}}]}}, + {"type": "Microsoft.Network/networkSecurityGroups", "name": "vm-diskforcedetach-testNSG", + "apiVersion": "2015-06-15", "location": "westus", "tags": {}, "dependsOn": []}, + {"apiVersion": "2018-01-01", "type": "Microsoft.Network/publicIPAddresses", + "name": "vm-diskforcedetach-testPublicIP", "location": "westus", "tags": {}, + "dependsOn": [], "properties": {"publicIPAllocationMethod": null}}, {"apiVersion": + "2015-06-15", "type": "Microsoft.Network/networkInterfaces", "name": "vm-diskforcedetach-testVMNic", + "location": "westus", "tags": {}, "dependsOn": ["Microsoft.Network/virtualNetworks/vm-diskforcedetach-testVNET", + "Microsoft.Network/networkSecurityGroups/vm-diskforcedetach-testNSG", "Microsoft.Network/publicIpAddresses/vm-diskforcedetach-testPublicIP"], + "properties": {"ipConfigurations": [{"name": "ipconfigvm-diskforcedetach-test", + "properties": {"privateIPAllocationMethod": "Dynamic", "subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/virtualNetworks/vm-diskforcedetach-testVNET/subnets/vm-diskforcedetach-testSubnet"}, + "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/publicIPAddresses/vm-diskforcedetach-testPublicIP"}}}], + "networkSecurityGroup": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkSecurityGroups/vm-diskforcedetach-testNSG"}}}, + {"apiVersion": "2022-03-01", "type": "Microsoft.Compute/virtualMachines", "name": + "vm-diskforcedetach-test", "location": "westus", "tags": {}, "dependsOn": ["Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic"], + "properties": {"hardwareProfile": {"vmSize": "Standard_DS1_v2"}, "networkProfile": + {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic", + "properties": {"deleteOption": null}}]}, "storageProfile": {"osDisk": {"createOption": + "fromImage", "name": null, "caching": "ReadWrite", "managedDisk": {"storageAccountType": + null}}, "imageReference": {"publisher": "OpenLogic", "offer": "CentOS", "sku": + "7.5", "version": "latest"}}, "osProfile": {"computerName": "vm-diskforcedetach-test", + "adminUsername": "admin123", "adminPassword": "[parameters(''adminPassword'')]"}}}], + "outputs": {}}, "parameters": {"adminPassword": {"value": "testPassword0"}}, + "mode": "incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '3229' + Content-Type: + - application/json + ParameterSetName: + - -g --location -n --admin-username --image --admin-password --authentication-type + --nsg-rule + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-test-disk-force-detach000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Resources/deployments/vm_deploy_577qO4hMmSIEXJ24UabT9QzugDbJbTmC","name":"vm_deploy_577qO4hMmSIEXJ24UabT9QzugDbJbTmC","type":"Microsoft.Resources/deployments","properties":{"templateHash":"15891242011793876138","parameters":{"adminPassword":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2022-07-27T10:14:56.4924013Z","duration":"PT0.000123S","correlationId":"6ddd79d9-ab16-4d17-b798-27698399ffe3","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]},{"resourceType":"networkSecurityGroups","locations":["westus"]},{"resourceType":"publicIPAddresses","locations":["westus"]},{"resourceType":"networkInterfaces","locations":["westus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines","locations":["westus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/virtualNetworks/vm-diskforcedetach-testVNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vm-diskforcedetach-testVNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkSecurityGroups/vm-diskforcedetach-testNSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vm-diskforcedetach-testNSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/publicIPAddresses/vm-diskforcedetach-testPublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vm-diskforcedetach-testPublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm-diskforcedetach-testVMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm-diskforcedetach-testVMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm-diskforcedetach-test"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-test-disk-force-detach000001/providers/Microsoft.Resources/deployments/vm_deploy_577qO4hMmSIEXJ24UabT9QzugDbJbTmC/operationStatuses/08585426899915929145?api-version=2021-04-01 + cache-control: + - no-cache + content-length: + - '2720' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:14:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g --location -n --admin-username --image --admin-password --authentication-type + --nsg-rule + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-test-disk-force-detach000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585426899915929145?api-version=2021-04-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:20:36 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g --location -n --admin-username --image --admin-password --authentication-type + --nsg-rule + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-test-disk-force-detach000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Resources/deployments/vm_deploy_577qO4hMmSIEXJ24UabT9QzugDbJbTmC","name":"vm_deploy_577qO4hMmSIEXJ24UabT9QzugDbJbTmC","type":"Microsoft.Resources/deployments","properties":{"templateHash":"15891242011793876138","parameters":{"adminPassword":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2022-07-27T10:16:50.5116578Z","duration":"PT1M54.0193795S","correlationId":"6ddd79d9-ab16-4d17-b798-27698399ffe3","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]},{"resourceType":"networkSecurityGroups","locations":["westus"]},{"resourceType":"publicIPAddresses","locations":["westus"]},{"resourceType":"networkInterfaces","locations":["westus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines","locations":["westus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/virtualNetworks/vm-diskforcedetach-testVNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vm-diskforcedetach-testVNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkSecurityGroups/vm-diskforcedetach-testNSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vm-diskforcedetach-testNSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/publicIPAddresses/vm-diskforcedetach-testPublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vm-diskforcedetach-testPublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm-diskforcedetach-testVMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm-diskforcedetach-testVMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm-diskforcedetach-test"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkSecurityGroups/vm-diskforcedetach-testNSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/publicIPAddresses/vm-diskforcedetach-testPublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/virtualNetworks/vm-diskforcedetach-testVNET"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3673' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:20:36 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g --location -n --admin-username --image --admin-password --authentication-type + --nsg-rule + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?$expand=instanceView&api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": + {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n \"adminUsername\": + \"admin123\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"instanceView\": {\r\n \"computerName\": + \"vm-diskforcedetach-test\",\r\n \"osName\": \"centos\",\r\n \"osVersion\": + \"7.5.1804\",\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.8.0.9\",\r\n + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n + \ \"message\": \"Guest Agent is running\",\r\n \"time\": + \"2022-07-27T10:19:50+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": + []\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2022-07-27T10:15:18.7200722+00:00\"\r\n + \ }\r\n ]\r\n }\r\n ],\r\n \"hyperVGeneration\": + \"V1\",\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2022-07-27T10:16:48.1421129+00:00\"\r\n + \ },\r\n {\r\n \"code\": \"PowerState/running\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"VM running\"\r\n + \ }\r\n ]\r\n },\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3465' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:20:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3994,Microsoft.Compute/LowCostGet30Min;31945 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g --location -n --admin-username --image --admin-password --authentication-type + --nsg-rule + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic?api-version=2018-01-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-testVMNic\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\",\r\n + \ \"etag\": \"W/\\\"6b75cb7a-80de-426c-ab27-fd29428cc9a9\\\"\",\r\n \"tags\": + {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"536c48d5-bf07-4dc1-ac94-a10c6cd53363\",\r\n \"ipConfigurations\": + [\r\n {\r\n \"name\": \"ipconfigvm-diskforcedetach-test\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic/ipConfigurations/ipconfigvm-diskforcedetach-test\",\r\n + \ \"etag\": \"W/\\\"6b75cb7a-80de-426c-ab27-fd29428cc9a9\\\"\",\r\n + \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": + \"Dynamic\",\r\n \"publicIPAddress\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/publicIPAddresses/vm-diskforcedetach-testPublicIP\"\r\n + \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/virtualNetworks/vm-diskforcedetach-testVNET/subnets/vm-diskforcedetach-testSubnet\"\r\n + \ },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": + \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": + [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": + \"dnxrexvlirfe3bdvqtydpsjxnh.dx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": + \"00-0D-3A-58-D3-CB\",\r\n \"enableIPForwarding\": false,\r\n \"networkSecurityGroup\": + {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkSecurityGroups/vm-diskforcedetach-testNSG\"\r\n + \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2467' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:20:40 GMT + etag: + - W/"6b75cb7a-80de-426c-ab27-fd29428cc9a9" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 4620c128-2129-4460-91a4-b8fb56d21c69 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g --location -n --admin-username --image --admin-password --authentication-type + --nsg-rule + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/publicIPAddresses/vm-diskforcedetach-testPublicIP?api-version=2018-01-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-testPublicIP\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/publicIPAddresses/vm-diskforcedetach-testPublicIP\",\r\n + \ \"etag\": \"W/\\\"d3c1174a-459d-4e7c-a883-a08591e8ae23\\\"\",\r\n \"location\": + \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"86b030dd-751c-429f-a4f3-68f4efdf927a\",\r\n + \ \"ipAddress\": \"20.245.164.31\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n + \ \"publicIPAllocationMethod\": \"Dynamic\",\r\n \"idleTimeoutInMinutes\": + 4,\r\n \"ipTags\": [],\r\n \"ipConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic/ipConfigurations/ipconfigvm-diskforcedetach-test\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n + \ \"sku\": {\r\n \"name\": \"Basic\"\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '991' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:20:41 GMT + etag: + - W/"d3c1174a-459d-4e7c-a883-a08591e8ae23" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 98f9d0c8-7c74-4147-a34b-5e2cc3d0d190 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --new --size-gb --caching + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": + {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n \"adminUsername\": + \"admin123\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2129' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:20:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31944 + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "properties": {"hardwareProfile": {"vmSize": + "Standard_DS1_v2"}, "storageProfile": {"osDisk": {"osType": "Linux", "name": + "vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", "caching": + "ReadWrite", "createOption": "FromImage", "diskSizeGB": 30, "managedDisk": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", + "storageAccountType": "Premium_LRS"}, "deleteOption": "Detach"}, "dataDisks": + [{"lun": 0, "name": "d1", "caching": "ReadOnly", "createOption": "Empty", "diskSizeGB": + 1, "managedDisk": {}}]}, "osProfile": {"computerName": "vm-diskforcedetach-test", + "adminUsername": "admin123", "linuxConfiguration": {"disablePasswordAuthentication": + false, "provisionVMAgent": true, "patchSettings": {"patchMode": "ImageDefault", + "assessmentMode": "ImageDefault"}}, "secrets": [], "allowExtensionOperations": + true, "requireGuestProvisionSignal": true}, "networkProfile": {"networkInterfaces": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic"}]}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + Content-Length: + - '1287' + Content-Type: + - application/json + ParameterSetName: + - -g --vm-name --name --new --size-gb --caching + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Premium_LRS\"\r\n },\r\n \"deleteOption\": \"Detach\",\r\n + \ \"diskSizeGB\": 1,\r\n \"toBeDetached\": false\r\n }\r\n + \ ]\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Updating\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/a8b7976a-6fda-44ba-8174-cc7f6827d6fb?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + cache-control: + - no-cache + content-length: + - '2463' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:20:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1198 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --new --size-gb --caching + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/a8b7976a-6fda-44ba-8174-cc7f6827d6fb?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + response: + body: + string: "{\r\n \"startTime\": \"2022-07-27T10:20:45.5174622+00:00\",\r\n \"endTime\": + \"2022-07-27T10:20:52.5956294+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"a8b7976a-6fda-44ba-8174-cc7f6827d6fb\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:21:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29997 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --new --size-gb --caching + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Premium_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2623' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:21:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3990,Microsoft.Compute/LowCostGet30Min;31939 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --new --size-gb --lun --sku + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Premium_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2623' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:21:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3989,Microsoft.Compute/LowCostGet30Min;31938 + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "properties": {"hardwareProfile": {"vmSize": + "Standard_DS1_v2"}, "storageProfile": {"osDisk": {"osType": "Linux", "name": + "vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", "caching": + "ReadWrite", "createOption": "FromImage", "diskSizeGB": 30, "managedDisk": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", + "storageAccountType": "Premium_LRS"}, "deleteOption": "Detach"}, "dataDisks": + [{"lun": 0, "name": "d1", "caching": "ReadOnly", "createOption": "Empty", "diskSizeGB": + 1, "managedDisk": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1", + "storageAccountType": "Premium_LRS"}, "toBeDetached": false, "deleteOption": + "Detach"}, {"lun": 2, "name": "d2", "createOption": "Empty", "diskSizeGB": 2, + "managedDisk": {"storageAccountType": "Standard_LRS"}}]}, "osProfile": {"computerName": + "vm-diskforcedetach-test", "adminUsername": "admin123", "linuxConfiguration": + {"disablePasswordAuthentication": false, "provisionVMAgent": true, "patchSettings": + {"patchMode": "ImageDefault", "assessmentMode": "ImageDefault"}}, "secrets": + [], "allowExtensionOperations": true, "requireGuestProvisionSignal": true}, + "networkProfile": {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic"}]}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + Content-Length: + - '1640' + Content-Type: + - application/json + ParameterSetName: + - -g --vm-name --name --new --size-gb --lun --sku + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Premium_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n \"lun\": + 2,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\"\r\n },\r\n \"deleteOption\": \"Detach\",\r\n + \ \"diskSizeGB\": 2,\r\n \"toBeDetached\": false\r\n }\r\n + \ ]\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Updating\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/e7379e01-c0cc-4458-a8dd-7ae7c0aefd13?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + cache-control: + - no-cache + content-length: + - '2947' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:21:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/PutVM3Min;238,Microsoft.Compute/PutVM30Min;1197 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --new --size-gb --lun --sku + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/e7379e01-c0cc-4458-a8dd-7ae7c0aefd13?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + response: + body: + string: "{\r\n \"startTime\": \"2022-07-27T10:21:24.2053586+00:00\",\r\n \"endTime\": + \"2022-07-27T10:21:31.0491581+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"e7379e01-c0cc-4458-a8dd-7ae7c0aefd13\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:21:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29996 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --new --size-gb --lun --sku + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Premium_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n \"lun\": + 2,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:21:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3987,Microsoft.Compute/LowCostGet30Min;31936 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Premium_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n \"lun\": + 2,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:21:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3986,Microsoft.Compute/LowCostGet30Min;31935 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Premium_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n \"lun\": + 2,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:21:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3985,Microsoft.Compute/LowCostGet30Min;31934 + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "properties": {"hardwareProfile": {"vmSize": + "Standard_DS1_v2"}, "storageProfile": {"osDisk": {"osType": "Linux", "name": + "vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", "caching": + "ReadWrite", "createOption": "FromImage", "diskSizeGB": 30, "managedDisk": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", + "storageAccountType": "Premium_LRS"}, "deleteOption": "Detach"}, "dataDisks": + [{"lun": 2, "name": "d2", "caching": "None", "createOption": "Empty", "diskSizeGB": + 2, "managedDisk": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2", + "storageAccountType": "Standard_LRS"}, "toBeDetached": false, "deleteOption": + "Detach"}]}, "osProfile": {"computerName": "vm-diskforcedetach-test", "adminUsername": + "admin123", "linuxConfiguration": {"disablePasswordAuthentication": false, "provisionVMAgent": + true, "patchSettings": {"patchMode": "ImageDefault", "assessmentMode": "ImageDefault"}}, + "secrets": [], "allowExtensionOperations": true, "requireGuestProvisionSignal": + true}, "networkProfile": {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic"}]}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + Content-Length: + - '1514' + Content-Type: + - application/json + ParameterSetName: + - -g --vm-name -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Premium_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": true\r\n },\r\n {\r\n \"lun\": + 2,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Updating\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/3050d480-00c4-4e50-a28c-17a3ad43af69?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + cache-control: + - no-cache + content-length: + - '3105' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:22:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/PutVM3Min;237,Microsoft.Compute/PutVM30Min;1196 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/3050d480-00c4-4e50-a28c-17a3ad43af69?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + response: + body: + string: "{\r\n \"startTime\": \"2022-07-27T10:22:02.799274+00:00\",\r\n \"endTime\": + \"2022-07-27T10:22:17.9555347+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"3050d480-00c4-4e50-a28c-17a3ad43af69\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '183' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:22:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29995 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 2,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2620' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:22:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3983,Microsoft.Compute/LowCostGet30Min;31929 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 2,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2620' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:22:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3982,Microsoft.Compute/LowCostGet30Min;31928 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n --force-detach + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 2,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2620' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:22:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3981,Microsoft.Compute/LowCostGet30Min;31927 + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "properties": {"hardwareProfile": {"vmSize": + "Standard_DS1_v2"}, "storageProfile": {"osDisk": {"osType": "Linux", "name": + "vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", "caching": + "ReadWrite", "createOption": "FromImage", "diskSizeGB": 30, "managedDisk": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", + "storageAccountType": "Premium_LRS"}, "deleteOption": "Detach"}, "dataDisks": + [{"lun": 2, "name": "d2", "caching": "None", "createOption": "Empty", "diskSizeGB": + 2, "managedDisk": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2", + "storageAccountType": "Standard_LRS"}, "toBeDetached": true, "detachOption": + "ForceDetach", "deleteOption": "Detach"}]}, "osProfile": {"computerName": "vm-diskforcedetach-test", + "adminUsername": "admin123", "linuxConfiguration": {"disablePasswordAuthentication": + false, "provisionVMAgent": true, "patchSettings": {"patchMode": "ImageDefault", + "assessmentMode": "ImageDefault"}}, "secrets": [], "allowExtensionOperations": + true, "requireGuestProvisionSignal": true}, "networkProfile": {"networkInterfaces": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic"}]}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + Content-Length: + - '1544' + Content-Type: + - application/json + ParameterSetName: + - -g --vm-name -n --force-detach + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 2,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Empty\",\r\n + \ \"caching\": \"None\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": true,\r\n \"detachOption\": \"ForceDetach\"\r\n + \ }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \"computerName\": + \"vm-diskforcedetach-test\",\r\n \"adminUsername\": \"admin123\",\r\n + \ \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Updating\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/96f9a03d-006d-486a-a460-dbba67e76e43?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + cache-control: + - no-cache + content-length: + - '2660' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:22:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/PutVM3Min;236,Microsoft.Compute/PutVM30Min;1195 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n --force-detach + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/96f9a03d-006d-486a-a460-dbba67e76e43?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + response: + body: + string: "{\r\n \"startTime\": \"2022-07-27T10:22:42.1587207+00:00\",\r\n \"endTime\": + \"2022-07-27T10:22:42.5024839+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"96f9a03d-006d-486a-a460-dbba67e76e43\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29993 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n --force-detach + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": + {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n \"adminUsername\": + \"admin123\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2129' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3978,Microsoft.Compute/LowCostGet30Min;31924 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": + {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n \"adminUsername\": + \"admin123\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2129' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3977,Microsoft.Compute/LowCostGet30Min;31923 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --caching --sku + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": + {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n \"adminUsername\": + \"admin123\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2129' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3976,Microsoft.Compute/LowCostGet30Min;31922 + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "properties": {"hardwareProfile": {"vmSize": + "Standard_DS1_v2"}, "storageProfile": {"osDisk": {"osType": "Linux", "name": + "vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", "caching": + "ReadWrite", "createOption": "FromImage", "diskSizeGB": 30, "managedDisk": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", + "storageAccountType": "Premium_LRS"}, "deleteOption": "Detach"}, "dataDisks": + [{"lun": 0, "caching": "ReadWrite", "createOption": "Attach", "managedDisk": + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1", + "storageAccountType": "Standard_LRS"}}]}, "osProfile": {"computerName": "vm-diskforcedetach-test", + "adminUsername": "admin123", "linuxConfiguration": {"disablePasswordAuthentication": + false, "provisionVMAgent": true, "patchSettings": {"patchMode": "ImageDefault", + "assessmentMode": "ImageDefault"}}, "secrets": [], "allowExtensionOperations": + true, "requireGuestProvisionSignal": true}, "networkProfile": {"networkInterfaces": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic"}]}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + Content-Length: + - '1440' + Content-Type: + - application/json + ParameterSetName: + - -g --vm-name --name --caching --sku + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Updating\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/e845e0c7-0b2f-4168-8f6d-fbe1b1149706?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + cache-control: + - no-cache + content-length: + - '2625' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/PutVM3Min;235,Microsoft.Compute/PutVM30Min;1194 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --caching --sku + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/e845e0c7-0b2f-4168-8f6d-fbe1b1149706?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + response: + body: + string: "{\r\n \"startTime\": \"2022-07-27T10:23:20.6900919+00:00\",\r\n \"endTime\": + \"2022-07-27T10:23:29.7525808+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"e845e0c7-0b2f-4168-8f6d-fbe1b1149706\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29991 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --caching --sku + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2626' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3976,Microsoft.Compute/LowCostGet30Min;31918 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2626' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3975,Microsoft.Compute/LowCostGet30Min;31917 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n --force-detach + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2626' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:55 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3974,Microsoft.Compute/LowCostGet30Min;31916 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2626' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3973,Microsoft.Compute/LowCostGet30Min;31915 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --size-gb --caching + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2626' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:23:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3972,Microsoft.Compute/LowCostGet30Min;31914 + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "properties": {"hardwareProfile": {"vmSize": + "Standard_DS1_v2"}, "storageProfile": {"osDisk": {"osType": "Linux", "name": + "vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", "caching": + "ReadWrite", "createOption": "FromImage", "diskSizeGB": 30, "managedDisk": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", + "storageAccountType": "Premium_LRS"}, "deleteOption": "Detach"}, "dataDisks": + [{"lun": 0, "name": "d1", "caching": "ReadWrite", "createOption": "Attach", + "diskSizeGB": 1, "managedDisk": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1", + "storageAccountType": "Standard_LRS"}, "toBeDetached": false, "deleteOption": + "Detach"}, {"lun": 1, "caching": "ReadOnly", "createOption": "Attach", "managedDisk": + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2"}}]}, + "osProfile": {"computerName": "vm-diskforcedetach-test", "adminUsername": "admin123", + "linuxConfiguration": {"disablePasswordAuthentication": false, "provisionVMAgent": + true, "patchSettings": {"patchMode": "ImageDefault", "assessmentMode": "ImageDefault"}}, + "secrets": [], "allowExtensionOperations": true, "requireGuestProvisionSignal": + true}, "networkProfile": {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic"}]}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + Content-Length: + - '1744' + Content-Type: + - application/json + ParameterSetName: + - -g --vm-name --name --size-gb --caching + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n \"lun\": + 1,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Updating\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/458fdaa5-404b-483b-acbc-ff1d9061247f?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + cache-control: + - no-cache + content-length: + - '3114' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:24:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/PutVM3Min;236,Microsoft.Compute/PutVM30Min;1193 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --size-gb --caching + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/458fdaa5-404b-483b-acbc-ff1d9061247f?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + response: + body: + string: "{\r\n \"startTime\": \"2022-07-27T10:24:01.4245789+00:00\",\r\n \"endTime\": + \"2022-07-27T10:24:12.330783+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"458fdaa5-404b-483b-acbc-ff1d9061247f\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '183' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:24:33 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14993,Microsoft.Compute/GetOperation30Min;29989 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk attach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name --name --size-gb --caching + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n \"lun\": + 1,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3115' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:24:33 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3975,Microsoft.Compute/LowCostGet30Min;31909 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n \"lun\": + 1,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3115' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:24:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3974,Microsoft.Compute/LowCostGet30Min;31908 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n --force-detach + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n \"lun\": + 1,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3115' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:24:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3973,Microsoft.Compute/LowCostGet30Min;31907 + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "properties": {"hardwareProfile": {"vmSize": + "Standard_DS1_v2"}, "storageProfile": {"osDisk": {"osType": "Linux", "name": + "vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", "caching": + "ReadWrite", "createOption": "FromImage", "diskSizeGB": 30, "managedDisk": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa", + "storageAccountType": "Premium_LRS"}, "deleteOption": "Detach"}, "dataDisks": + [{"lun": 0, "name": "d1", "caching": "ReadWrite", "createOption": "Attach", + "diskSizeGB": 1, "managedDisk": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1", + "storageAccountType": "Standard_LRS"}, "toBeDetached": false, "deleteOption": + "Detach"}, {"lun": 1, "name": "d2", "caching": "ReadOnly", "createOption": "Attach", + "diskSizeGB": 2, "managedDisk": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2", + "storageAccountType": "Standard_LRS"}, "toBeDetached": true, "detachOption": + "ForceDetach", "deleteOption": "Detach"}]}, "osProfile": {"computerName": "vm-diskforcedetach-test", + "adminUsername": "admin123", "linuxConfiguration": {"disablePasswordAuthentication": + false, "provisionVMAgent": true, "patchSettings": {"patchMode": "ImageDefault", + "assessmentMode": "ImageDefault"}}, "secrets": [], "allowExtensionOperations": + true, "requireGuestProvisionSignal": true}, "networkProfile": {"networkInterfaces": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic"}]}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + Content-Length: + - '1892' + Content-Type: + - application/json + ParameterSetName: + - -g --vm-name -n --force-detach + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n },\r\n {\r\n \"lun\": + 1,\r\n \"name\": \"d2\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadOnly\",\r\n \"managedDisk\": {\r\n \"storageAccountType\": + \"Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d2\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 2,\r\n \"toBeDetached\": true,\r\n \"detachOption\": \"ForceDetach\"\r\n + \ }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \"computerName\": + \"vm-diskforcedetach-test\",\r\n \"adminUsername\": \"admin123\",\r\n + \ \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + false,\r\n \"provisionVMAgent\": true,\r\n \"patchSettings\": + {\r\n \"patchMode\": \"ImageDefault\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Updating\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/b25880ff-cf36-4a1f-bfd0-7b7599212eaf?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + cache-control: + - no-cache + content-length: + - '3155' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:24:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/PutVM3Min;235,Microsoft.Compute/PutVM30Min;1192 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n --force-detach + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/operations/b25880ff-cf36-4a1f-bfd0-7b7599212eaf?p=571046f6-b640-41c1-86f7-f9f044b5adf9&api-version=2022-03-01 + response: + body: + string: "{\r\n \"startTime\": \"2022-07-27T10:24:41.1436201+00:00\",\r\n \"endTime\": + \"2022-07-27T10:24:41.4714732+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"b25880ff-cf36-4a1f-bfd0-7b7599212eaf\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:25:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29987 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm disk detach + Connection: + - keep-alive + ParameterSetName: + - -g --vm-name -n --force-detach + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2626' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:25:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3972,Microsoft.Compute/LowCostGet30Min;31914 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-compute/27.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test?api-version=2022-03-01 + response: + body: + string: "{\r\n \"name\": \"vm-diskforcedetach-test\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/virtualMachines/vm-diskforcedetach-test\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"57848086-d73c-45d5-a164-16d25e135b7e\",\r\n + \ \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_DS1_v2\"\r\n },\r\n + \ \"storageProfile\": {\r\n \"imageReference\": {\r\n \"publisher\": + \"OpenLogic\",\r\n \"offer\": \"CentOS\",\r\n \"sku\": \"7.5\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"7.5.201808150\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Linux\",\r\n \"name\": + \"vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\",\r\n + \ \"createOption\": \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n + \ \"managedDisk\": {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/vm-diskforcedetach-test_OsDisk_1_a1b5d76579fb45918f6b7a3e982d5ffa\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 30\r\n },\r\n \"dataDisks\": [\r\n {\r\n \"lun\": + 0,\r\n \"name\": \"d1\",\r\n \"createOption\": \"Attach\",\r\n + \ \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n + \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Compute/disks/d1\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 1,\r\n \"toBeDetached\": false\r\n }\r\n ]\r\n },\r\n + \ \"osProfile\": {\r\n \"computerName\": \"vm-diskforcedetach-test\",\r\n + \ \"adminUsername\": \"admin123\",\r\n \"linuxConfiguration\": {\r\n + \ \"disablePasswordAuthentication\": false,\r\n \"provisionVMAgent\": + true,\r\n \"patchSettings\": {\r\n \"patchMode\": \"ImageDefault\",\r\n + \ \"assessmentMode\": \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-test-disk-force-detach000001/providers/Microsoft.Network/networkInterfaces/vm-diskforcedetach-testVMNic\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"timeCreated\": \"2022-07-27T10:15:16.8606664+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2626' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 27 Jul 2022 10:25:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3971,Microsoft.Compute/LowCostGet30Min;31913 + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_custom_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_custom_vm_commands.py index f2b2005af40..031ab99d46d 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_custom_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_custom_vm_commands.py @@ -16,7 +16,7 @@ _get_extension_instance_name, get_boot_log) from azure.cli.command_modules.vm.custom import \ - (attach_unmanaged_data_disk, detach_data_disk, get_vmss_instance_view) + (attach_unmanaged_data_disk, detach_unmanaged_data_disk, get_vmss_instance_view) from azure.cli.core import AzCommandsLoader from azure.cli.core.commands import AzCliCommand @@ -206,7 +206,7 @@ def test_deattach_disk_on_vm(self, mock_vm_set, mock_vm_get_to_update): mock_vm_get_to_update.return_value = vm # execute - detach_data_disk(cmd, 'rg1', 'vm1', 'd1') + detach_unmanaged_data_disk(cmd, 'rg1', 'vm1', 'd1') # assert self.assertTrue(mock_vm_get_to_update.called) diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py index 3f050469463..f0d957029e0 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py @@ -2747,6 +2747,69 @@ def test_vm_disk_attach_detach(self, resource_group): self.check('storageProfile.dataDisks[0].lun', 0) ]) + @ResourceGroupPreparer(name_prefix='cli-test-disk-force-detach') + def test_vm_disk_force_detach(self, resource_group): + self.kwargs.update({ + 'loc': 'westus', + 'vm': 'vm-diskforcedetach-test', + 'disk1': 'd1', + 'disk2': 'd2' + }) + + self.cmd('vm create -g {rg} --location {loc} -n {vm} --admin-username admin123 --image centos ' + '--admin-password testPassword0 --authentication-type password --nsg-rule NONE') + + self.cmd('vm disk attach -g {rg} --vm-name {vm} --name {disk1} --new --size-gb 1 --caching ReadOnly') + self.cmd('vm disk attach -g {rg} --vm-name {vm} --name {disk2} --new --size-gb 2 --lun 2 --sku standard_lrs') + self.cmd('vm show -g {rg} -n {vm}', checks=[ + self.check('length(storageProfile.dataDisks)', 2), + self.check('storageProfile.dataDisks[0].name', '{disk1}'), + self.check('storageProfile.dataDisks[0].caching', 'ReadOnly'), + self.check('storageProfile.dataDisks[0].managedDisk.storageAccountType', 'Premium_LRS'), + self.check('storageProfile.dataDisks[1].name', '{disk2}'), + self.check('storageProfile.dataDisks[1].lun', 2), + self.check('storageProfile.dataDisks[1].managedDisk.storageAccountType', 'Standard_LRS'), + self.check('storageProfile.dataDisks[1].caching', 'None') + ]) + self.cmd('vm disk detach -g {rg} --vm-name {vm} -n {disk1}') + self.cmd('vm show -g {rg} -n {vm}', checks=[ + self.check('length(storageProfile.dataDisks)', 1), + self.check('storageProfile.dataDisks[0].name', '{disk2}'), + self.check('storageProfile.dataDisks[0].lun', 2) + ]) + + # force detach a disk + self.cmd('vm disk detach -g {rg} --vm-name {vm} -n {disk2} --force-detach') + self.cmd('vm show -g {rg} -n {vm}', checks=[ + self.check('length(storageProfile.dataDisks)', 0) + ]) + + self.cmd('vm disk attach -g {rg} --vm-name {vm} --name {disk1} --caching ReadWrite --sku standard_lrs') + self.cmd('vm show -g {rg} -n {vm}', checks=[ + self.check('storageProfile.dataDisks[0].caching', 'ReadWrite'), + self.check('storageProfile.dataDisks[0].managedDisk.storageAccountType', 'Standard_LRS'), + self.check('storageProfile.dataDisks[0].lun', 0) + ]) + + # detach a not existing disk + from azure.cli.core.azclierror import ResourceNotFoundError + with self.assertRaises(ResourceNotFoundError): + self.cmd('vm disk detach -g {rg} --vm-name {vm} -n {disk2} --force-detach') + with self.assertRaises(ResourceNotFoundError): + self.cmd('vm disk detach -g {rg} --vm-name {vm} -n {disk2}') + + self.cmd('vm disk attach -g {rg} --vm-name {vm} --name {disk2} --size-gb 1 --caching ReadOnly') + self.cmd('vm show -g {rg} -n {vm}', checks=[ + self.check('length(storageProfile.dataDisks)', 2) + ]) + + # force detach a disk + self.cmd('vm disk detach -g {rg} --vm-name {vm} -n {disk2} --force-detach') + self.cmd('vm show -g {rg} -n {vm}', checks=[ + self.check('length(storageProfile.dataDisks)', 1), + self.check('storageProfile.dataDisks[0].name', '{disk1}') + ]) + @ResourceGroupPreparer(name_prefix='cli-test-disk-attach-multiple-disks') def test_vm_disk_attach_multiple_disks(self, resource_group):