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 9eaacfc82ec..fcc2f377205 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_params.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_params.py @@ -948,6 +948,9 @@ def load_arguments(self, _): help='Space-separated list of customer managed keys for encrypting the OS and data disks in the gallery artifact for each region. Format for each region: `,,,,`. Use "null" as a placeholder.') c.argument('os_vhd_uri', help='Source VHD URI of OS disk') c.argument('os_vhd_storage_account', help='Name or ID of storage account of source VHD URI of OS disk') + c.argument('data_vhds_uris', nargs='+', help='Source VHD URIs (space-delimited) of data disks') + c.argument('data_vhds_luns', nargs='+', help='Logical unit numbers (space-delimited) of source VHD URIs of data disks') + c.argument('data_vhds_storage_accounts', options_list=['--data-vhds-storage-accounts', '--data-vhds-sa'], nargs='+', help='Names or IDs (space-delimited) of storage accounts of source VHD URIs of data disks') with self.argument_context('sig image-version show') as c: c.argument('expand', help="The expand expression to apply on the operation, e.g. 'ReplicationStatus'") 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 c49171dea08..1134a017157 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/custom.py +++ b/src/azure-cli/azure/cli/command_modules/vm/custom.py @@ -3396,7 +3396,8 @@ def create_image_version(cmd, resource_group_name, gallery_name, gallery_image_n location=None, target_regions=None, storage_account_type=None, end_of_life_date=None, exclude_from_latest=None, replica_count=None, tags=None, os_snapshot=None, data_snapshots=None, managed_image=None, data_snapshot_luns=None, - target_region_encryption=None, os_vhd_uri=None, os_vhd_storage_account=None): + target_region_encryption=None, os_vhd_uri=None, os_vhd_storage_account=None, + data_vhds_uris=None, data_vhds_luns=None, data_vhds_storage_accounts=None): # print(target_regions) from msrestazure.tools import resource_id, is_valid_resource_id from azure.cli.core.commands.client_factory import get_subscription_id @@ -3451,8 +3452,9 @@ def create_image_version(cmd, resource_group_name, gallery_name, gallery_image_n lun=data_snapshot_luns[i])) # from vhd, only support os image now if cmd.supported_api_version(min_api='2020-09-30', operation_group='gallery_image_versions'): + # OS disk if os_vhd_uri and os_vhd_storage_account is None or os_vhd_uri is None and os_vhd_storage_account: - raise ValidationError('--vhd and --vhd-storage-account should be used together.') + raise ValidationError('--os-vhd-uri and --os-vhd-storage-account should be used together.') if os_vhd_uri and os_vhd_storage_account: if not is_valid_resource_id(os_vhd_storage_account): os_vhd_storage_account = resource_id( @@ -3461,6 +3463,35 @@ def create_image_version(cmd, resource_group_name, gallery_name, gallery_image_n os_disk_image = GalleryOSDiskImage(source=GalleryArtifactVersionSource( id=os_vhd_storage_account, uri=os_vhd_uri)) + # Data disks + if data_vhds_uris and data_vhds_storage_accounts is None or \ + data_vhds_uris is None and data_vhds_storage_accounts: + raise ValidationError('--data-vhds-uris and --data-vhds-storage-accounts should be used together.') + if data_vhds_luns and data_vhds_uris is None: + raise ValidationError('--data-vhds-luns must be used together with --data-vhds-uris') + if data_vhds_uris: + # Generate LUNs + if data_vhds_luns is None: + # 0, 1, 2, ... + data_vhds_luns = [i for i in range(len(data_vhds_uris))] + # Check length + len_data_vhds_uris = len(data_vhds_uris) + len_data_vhds_luns = len(data_vhds_luns) + len_data_vhds_storage_accounts = len(data_vhds_storage_accounts) + if len_data_vhds_uris != len_data_vhds_luns or len_data_vhds_uris != len_data_vhds_storage_accounts: + raise ValidationError('Length of --data-vhds-uris, --data-vhds-luns, --data-vhds-storage-accounts ' + 'must be same.') + # Generate full storage account ID + for i, storage_account in enumerate(data_vhds_storage_accounts): + if not is_valid_resource_id(storage_account): + data_vhds_storage_accounts[i] = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), resource_group=resource_group_name, + namespace='Microsoft.Storage', type='storageAccounts', name=storage_account) + data_disk_images = [] + for uri, lun, account in zip(data_vhds_uris, data_vhds_luns, data_vhds_storage_accounts): + data_disk_images.append(GalleryDataDiskImage( + source=GalleryArtifactVersionSource(id=account, uri=uri), lun=lun)) + storage_profile = GalleryImageVersionStorageProfile(source=source, os_disk_image=os_disk_image, data_disk_images=data_disk_images) image_version = ImageVersion(publishing_profile=profile, location=location, tags=(tags or {}), diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_gallery_image_version_vhd.yaml b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_gallery_image_version_vhd.yaml deleted file mode 100644 index 608136a6826..00000000000 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_gallery_image_version_vhd.yaml +++ /dev/null @@ -1,1872 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - vm create - Connection: - - keep-alive - ParameterSetName: - - -g -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.1.0 Azure-SDK-For-Python AZURECLI/2.22.0 - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001?api-version=2020-10-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001","name":"cli_test_gallery_image_version_vhd000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2021-04-20T05:24:29Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '428' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:24:30 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 - Connection: - - keep-alive - User-Agent: - - python-requests/2.22.0 - method: GET - uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/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 },\n - \ \"CoreOS\": {\n \"publisher\": \"CoreOS\",\n \"offer\": - \"CoreOS\",\n \"sku\": \"Stable\",\n \"version\": \"latest\"\n - \ },\n \"Debian\": {\n \"publisher\": \"Debian\",\n - \ \"offer\": \"debian-10\",\n \"sku\": \"10\",\n \"version\": - \"latest\"\n },\n \"openSUSE-Leap\": {\n \"publisher\": - \"SUSE\",\n \"offer\": \"openSUSE-Leap\",\n \"sku\": - \"42.3\",\n \"version\": \"latest\"\n },\n \"RHEL\": - {\n \"publisher\": \"RedHat\",\n \"offer\": \"RHEL\",\n - \ \"sku\": \"7-LVM\",\n \"version\": \"latest\"\n },\n - \ \"SLES\": {\n \"publisher\": \"SUSE\",\n \"offer\": - \"SLES\",\n \"sku\": \"15\",\n \"version\": \"latest\"\n - \ },\n \"UbuntuLTS\": {\n \"publisher\": \"Canonical\",\n - \ \"offer\": \"UbuntuServer\",\n \"sku\": \"18.04-LTS\",\n - \ \"version\": \"latest\"\n }\n },\n \"Windows\": - {\n \"Win2019Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\",\n - \ \"offer\": \"WindowsServer\",\n \"sku\": \"2019-Datacenter\",\n - \ \"version\": \"latest\"\n },\n \"Win2016Datacenter\": - {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": - \"WindowsServer\",\n \"sku\": \"2016-Datacenter\",\n \"version\": - \"latest\"\n },\n \"Win2012R2Datacenter\": {\n \"publisher\": - \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": - \"2012-R2-Datacenter\",\n \"version\": \"latest\"\n },\n - \ \"Win2012Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\",\n - \ \"offer\": \"WindowsServer\",\n \"sku\": \"2012-Datacenter\",\n - \ \"version\": \"latest\"\n },\n \"Win2008R2SP1\": - {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": - \"WindowsServer\",\n \"sku\": \"2008-R2-SP1\",\n \"version\": - \"latest\"\n }\n }\n }\n }\n }\n}\n" - headers: - accept-ranges: - - bytes - access-control-allow-origin: - - '*' - cache-control: - - max-age=300 - connection: - - keep-alive - content-length: - - '2501' - content-security-policy: - - default-src 'none'; style-src 'unsafe-inline'; sandbox - content-type: - - text/plain; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:24:30 GMT - etag: - - W/"540044b4084c3c314537f1baa1770f248628b2bc9ba0328f1004c33862e049da" - expires: - - Tue, 20 Apr 2021 05:29:30 GMT - source-age: - - '180' - strict-transport-security: - - max-age=31536000 - vary: - - Authorization,Accept-Encoding - via: - - 1.1 varnish - x-cache: - - HIT - x-cache-hits: - - '1' - x-content-type-options: - - nosniff - x-fastly-request-id: - - aed4f6c0bff0d3307ffe12d024fc143805de70fd - x-frame-options: - - deny - x-github-request-id: - - 7418:9060:96C86:BB51D:607E1B9B - x-served-by: - - cache-qpg1263-QPG - x-timer: - - S1618896271.875999,VS0,VE1 - 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 -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-storage/17.1.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Storage/storageAccounts?api-version=2021-02-01 - response: - body: - string: '{"value":[]}' - headers: - cache-control: - - no-cache - content-length: - - '12' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:24:30 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, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - vm create - Connection: - - keep-alive - ParameterSetName: - - -g -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-network/18.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/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: - - Tue, 20 Apr 2021 05:24:31 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": {}, "variables": {}, "resources": - [{"type": "Microsoft.Storage/storageAccounts", "name": "vhdstoragef1f251d35a243e", - "apiVersion": "2015-06-15", "location": "westus", "tags": {}, "dependsOn": [], - "properties": {"accountType": "Premium_LRS"}}, {"name": "vm1VNET", "type": "Microsoft.Network/virtualNetworks", - "location": "westus", "apiVersion": "2015-06-15", "dependsOn": [], "tags": {}, - "properties": {"addressSpace": {"addressPrefixes": ["10.0.0.0/16"]}, "subnets": - [{"name": "vm1Subnet", "properties": {"addressPrefix": "10.0.0.0/24"}}]}}, {"type": - "Microsoft.Network/networkSecurityGroups", "name": "vm1NSG", "apiVersion": "2015-06-15", - "location": "westus", "tags": {}, "dependsOn": []}, {"apiVersion": "2018-01-01", - "type": "Microsoft.Network/publicIPAddresses", "name": "vm1PublicIP", "location": - "westus", "tags": {}, "dependsOn": [], "properties": {"publicIPAllocationMethod": - null}}, {"apiVersion": "2015-06-15", "type": "Microsoft.Network/networkInterfaces", - "name": "vm1VMNic", "location": "westus", "tags": {}, "dependsOn": ["Microsoft.Network/virtualNetworks/vm1VNET", - "Microsoft.Network/networkSecurityGroups/vm1NSG", "Microsoft.Network/publicIpAddresses/vm1PublicIP"], - "properties": {"ipConfigurations": [{"name": "ipconfigvm1", "properties": {"privateIPAllocationMethod": - "Dynamic", "subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/virtualNetworks/vm1VNET/subnets/vm1Subnet"}, - "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP"}}}], - "networkSecurityGroup": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG"}}}, - {"apiVersion": "2020-12-01", "type": "Microsoft.Compute/virtualMachines", "name": - "vm1", "location": "westus", "tags": {}, "dependsOn": ["Microsoft.Storage/storageAccounts/vhdstoragef1f251d35a243e", - "Microsoft.Network/networkInterfaces/vm1VMNic"], "properties": {"hardwareProfile": - {"vmSize": "Standard_DS1_v2"}, "networkProfile": {"networkInterfaces": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic"}]}, - "storageProfile": {"osDisk": {"createOption": "fromImage", "name": "osdisk_f1f251d35a", - "caching": "ReadWrite", "vhd": {"uri": "https://vhdstoragef1f251d35a243e.blob.core.windows.net/vhds/osdisk_f1f251d35a.vhd"}}, - "imageReference": {"publisher": "OpenLogic", "offer": "CentOS", "sku": "7.5", - "version": "latest"}}, "osProfile": {"computerName": "vm1", "adminUsername": - "yishiwang", "linuxConfiguration": {"disablePasswordAuthentication": true, "ssh": - {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD0dGsd0lz5jXJMmQEmyJ2xC54pipNfQD8vWiFe2dntWOBNcYNm488wQdNDn/zf+9P87BG4TVOQdx3PbeGJZ8RnunefQipCsKpYnBABDW4zgLexbgyo6YVRt/iRxCLXK8PzXdBUC8R5pdj93nIsGa4rZSF2QklSHFb9LazwUzaa4H7HmnxwQHcCTpJMImcldd25wnTEbYqt6dYX227exlz6/Y/7MUEcPzTf7B+vCTTnlQqFaM6vCOQRhFFhKiVl47nENVxNn9opiGMYHwbC+EGokkf8fJko4mgsiCy/ADsXhtM13HquNn9KGCd4bfBnuT2cmO9EqPlmXWflwtlSnWNONGEpFhd2J3bMTSgJdkkSuAJwE3nzCfc3mgRVY9aZw3gA9Gc73Ti1FjClb54SUMM0Qco5A4NxdNzud8Ekr8prwU3sKrY4/fKJ0i6Eb/6Mf7BrLiaECSDuLsm0iXEtpLLukKoPlnRynWuUfJFi6xtpZR/dSoWTD3SS7HxXvXWe1ie5i0PN0SVV0uJpP2RnOWueFNcQmaKE+A2/oWD4bYY2gB0yvV9uGbBiIfAluQ25Yqrp8SrysDhGW672kuZV1JnQ+DitGCtxI5YtJloJxciz1r8zRFslJKexQlwebHbfTLi0jdVNIWvju32g+tI1nzeAwe2g8PwYi0e0RS7Q1cFFYQ== - yishiwang@microsoft.com\n", "path": "/home/yishiwang/.ssh/authorized_keys"}]}}}, - "securityProfile": {}}}], "outputs": {}}, "parameters": {}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - vm create - Connection: - - keep-alive - Content-Length: - - '4104' - Content-Type: - - application/json; charset=utf-8 - ParameterSetName: - - -g -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.1.0 Azure-SDK-For-Python AZURECLI/2.22.0 - accept-language: - - en-US - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-10-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Resources/deployments/vm_deploy_fdcCaggowRukLvEZ2ifdrLOzAlTg1VYb","name":"vm_deploy_fdcCaggowRukLvEZ2ifdrLOzAlTg1VYb","type":"Microsoft.Resources/deployments","properties":{"templateHash":"15802609616895111083","parameters":{},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2021-04-20T05:24:35.4881123Z","duration":"PT2.1949291S","correlationId":"b9786e33-4b72-423f-b240-026775eac208","providers":[{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]},{"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_gallery_image_version_vhd000001/providers/Microsoft.Network/virtualNetworks/vm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Storage/storageAccounts/vhdstoragef1f251d35a243e","resourceType":"Microsoft.Storage/storageAccounts","resourceName":"vhdstoragef1f251d35a243e"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/virtualMachines/vm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm1"}]}}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Resources/deployments/vm_deploy_fdcCaggowRukLvEZ2ifdrLOzAlTg1VYb/operationStatuses/08585827106121844631?api-version=2020-10-01 - cache-control: - - no-cache - content-length: - - '3167' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:24:36 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: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - vm create - Connection: - - keep-alive - ParameterSetName: - - -g -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.1.0 Azure-SDK-For-Python AZURECLI/2.22.0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585827106121844631?api-version=2020-10-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:25:07 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 -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.1.0 Azure-SDK-For-Python AZURECLI/2.22.0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585827106121844631?api-version=2020-10-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:25:37 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 -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.1.0 Azure-SDK-For-Python AZURECLI/2.22.0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585827106121844631?api-version=2020-10-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:26:08 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 -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.1.0 Azure-SDK-For-Python AZURECLI/2.22.0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585827106121844631?api-version=2020-10-01 - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:26:38 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 -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.1.0 Azure-SDK-For-Python AZURECLI/2.22.0 - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-10-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Resources/deployments/vm_deploy_fdcCaggowRukLvEZ2ifdrLOzAlTg1VYb","name":"vm_deploy_fdcCaggowRukLvEZ2ifdrLOzAlTg1VYb","type":"Microsoft.Resources/deployments","properties":{"templateHash":"15802609616895111083","parameters":{},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2021-04-20T05:26:29.5453844Z","duration":"PT1M56.2522012S","correlationId":"b9786e33-4b72-423f-b240-026775eac208","providers":[{"namespace":"Microsoft.Storage","resourceTypes":[{"resourceType":"storageAccounts","locations":["westus"]}]},{"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_gallery_image_version_vhd000001/providers/Microsoft.Network/virtualNetworks/vm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Storage/storageAccounts/vhdstoragef1f251d35a243e","resourceType":"Microsoft.Storage/storageAccounts","resourceName":"vhdstoragef1f251d35a243e"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/virtualMachines/vm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm1"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/virtualMachines/vm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/virtualNetworks/vm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Storage/storageAccounts/vhdstoragef1f251d35a243e"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '4455' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:26:38 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 -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/virtualMachines/vm1?$expand=instanceView&api-version=2020-12-01 - response: - body: - string: "{\r\n \"name\": \"vm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n - \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"226aa796-38cd-4703-835c-568950362e73\",\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\": - \"osdisk_f1f251d35a\",\r\n \"createOption\": \"FromImage\",\r\n \"vhd\": - {\r\n \"uri\": \"https://vhdstoragef1f251d35a243e.blob.core.windows.net/vhds/osdisk_f1f251d35a.vhd\"\r\n - \ },\r\n \"caching\": \"ReadWrite\",\r\n \"diskSizeGB\": - 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": - {\r\n \"computerName\": \"vm1\",\r\n \"adminUsername\": \"yishiwang\",\r\n - \ \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": - true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n - \ \"path\": \"/home/yishiwang/.ssh/authorized_keys\",\r\n \"keyData\": - \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD0dGsd0lz5jXJMmQEmyJ2xC54pipNfQD8vWiFe2dntWOBNcYNm488wQdNDn/zf+9P87BG4TVOQdx3PbeGJZ8RnunefQipCsKpYnBABDW4zgLexbgyo6YVRt/iRxCLXK8PzXdBUC8R5pdj93nIsGa4rZSF2QklSHFb9LazwUzaa4H7HmnxwQHcCTpJMImcldd25wnTEbYqt6dYX227exlz6/Y/7MUEcPzTf7B+vCTTnlQqFaM6vCOQRhFFhKiVl47nENVxNn9opiGMYHwbC+EGokkf8fJko4mgsiCy/ADsXhtM13HquNn9KGCd4bfBnuT2cmO9EqPlmXWflwtlSnWNONGEpFhd2J3bMTSgJdkkSuAJwE3nzCfc3mgRVY9aZw3gA9Gc73Ti1FjClb54SUMM0Qco5A4NxdNzud8Ekr8prwU3sKrY4/fKJ0i6Eb/6Mf7BrLiaECSDuLsm0iXEtpLLukKoPlnRynWuUfJFi6xtpZR/dSoWTD3SS7HxXvXWe1ie5i0PN0SVV0uJpP2RnOWueFNcQmaKE+A2/oWD4bYY2gB0yvV9uGbBiIfAluQ25Yqrp8SrysDhGW672kuZV1JnQ+DitGCtxI5YtJloJxciz1r8zRFslJKexQlwebHbfTLi0jdVNIWvju32g+tI1nzeAwe2g8PwYi0e0RS7Q1cFFYQ== - yishiwang@microsoft.com\\n\"\r\n }\r\n ]\r\n },\r\n - \ \"provisionVMAgent\": true,\r\n \"patchSettings\": {\r\n \"patchMode\": - \"ImageDefault\"\r\n }\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_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic\"}]},\r\n - \ \"provisioningState\": \"Succeeded\",\r\n \"instanceView\": {\r\n \"computerName\": - \"vm1\",\r\n \"osName\": \"centos\",\r\n \"osVersion\": \"7.5.1804\",\r\n - \ \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.2.54.2\",\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\": - \"2021-04-20T05:26:29+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": - []\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"osdisk_f1f251d35a\",\r\n - \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n - \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning - succeeded\",\r\n \"time\": \"2021-04-20T05:25:18.2238059+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\": \"2021-04-20T05:26:28.0519485+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 }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '3940' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:26: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;3976,Microsoft.Compute/LowCostGet30Min;31942 - 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 -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-network/18.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic?api-version=2018-01-01 - response: - body: - string: "{\r\n \"name\": \"vm1VMNic\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic\",\r\n - \ \"etag\": \"W/\\\"aad1bd23-ae6f-4322-9573-5e02f4110a27\\\"\",\r\n \"location\": - \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\",\r\n \"resourceGuid\": \"ebceaaca-57a3-4cd4-9647-882d17bc8384\",\r\n - \ \"ipConfigurations\": [\r\n {\r\n \"name\": \"ipconfigvm1\",\r\n - \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic/ipConfigurations/ipconfigvm1\",\r\n - \ \"etag\": \"W/\\\"aad1bd23-ae6f-4322-9573-5e02f4110a27\\\"\",\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_gallery_image_version_vhd000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP\"\r\n - \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/virtualNetworks/vm1VNET/subnets/vm1Subnet\"\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\": - \"c2ea0fr5glau1co5wktijplmrc.dx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": - \"00-22-48-04-8D-C2\",\r\n \"enableAcceleratedNetworking\": false,\r\n - \ \"enableIPForwarding\": false,\r\n \"networkSecurityGroup\": {\r\n - \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG\"\r\n - \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/virtualMachines/vm1\"\r\n - \ }\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '2568' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:26:40 GMT - etag: - - W/"aad1bd23-ae6f-4322-9573-5e02f4110a27" - 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: - - 1a237fc1-5adb-43e1-bb62-b2e8961e0f03 - 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 -n --image --use-unmanaged-disk --nsg-rule --generate-ssh-key - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-network/18.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP?api-version=2018-01-01 - response: - body: - string: "{\r\n \"name\": \"vm1PublicIP\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP\",\r\n - \ \"etag\": \"W/\\\"177691a3-3f85-4364-b11f-026e535d2a1c\\\"\",\r\n \"location\": - \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\",\r\n \"resourceGuid\": \"1389b5d7-2107-424a-b75e-2abeeda4ead4\",\r\n - \ \"ipAddress\": \"137.135.12.142\",\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_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic/ipConfigurations/ipconfigvm1\"\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: - - '998' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:26:40 GMT - etag: - - W/"177691a3-3f85-4364-b11f-026e535d2a1c" - 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: - - 7ba53797-1530-4646-ad04-deeac3d7dfdd - 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.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/virtualMachines/vm1?api-version=2020-12-01 - response: - body: - string: "{\r\n \"name\": \"vm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n - \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"226aa796-38cd-4703-835c-568950362e73\",\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\": - \"osdisk_f1f251d35a\",\r\n \"createOption\": \"FromImage\",\r\n \"vhd\": - {\r\n \"uri\": \"https://vhdstoragef1f251d35a243e.blob.core.windows.net/vhds/osdisk_f1f251d35a.vhd\"\r\n - \ },\r\n \"caching\": \"ReadWrite\",\r\n \"diskSizeGB\": - 30\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": - {\r\n \"computerName\": \"vm1\",\r\n \"adminUsername\": \"yishiwang\",\r\n - \ \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": - true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n - \ \"path\": \"/home/yishiwang/.ssh/authorized_keys\",\r\n \"keyData\": - \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD0dGsd0lz5jXJMmQEmyJ2xC54pipNfQD8vWiFe2dntWOBNcYNm488wQdNDn/zf+9P87BG4TVOQdx3PbeGJZ8RnunefQipCsKpYnBABDW4zgLexbgyo6YVRt/iRxCLXK8PzXdBUC8R5pdj93nIsGa4rZSF2QklSHFb9LazwUzaa4H7HmnxwQHcCTpJMImcldd25wnTEbYqt6dYX227exlz6/Y/7MUEcPzTf7B+vCTTnlQqFaM6vCOQRhFFhKiVl47nENVxNn9opiGMYHwbC+EGokkf8fJko4mgsiCy/ADsXhtM13HquNn9KGCd4bfBnuT2cmO9EqPlmXWflwtlSnWNONGEpFhd2J3bMTSgJdkkSuAJwE3nzCfc3mgRVY9aZw3gA9Gc73Ti1FjClb54SUMM0Qco5A4NxdNzud8Ekr8prwU3sKrY4/fKJ0i6Eb/6Mf7BrLiaECSDuLsm0iXEtpLLukKoPlnRynWuUfJFi6xtpZR/dSoWTD3SS7HxXvXWe1ie5i0PN0SVV0uJpP2RnOWueFNcQmaKE+A2/oWD4bYY2gB0yvV9uGbBiIfAluQ25Yqrp8SrysDhGW672kuZV1JnQ+DitGCtxI5YtJloJxciz1r8zRFslJKexQlwebHbfTLi0jdVNIWvju32g+tI1nzeAwe2g8PwYi0e0RS7Q1cFFYQ== - yishiwang@microsoft.com\\n\"\r\n }\r\n ]\r\n },\r\n - \ \"provisionVMAgent\": true,\r\n \"patchSettings\": {\r\n \"patchMode\": - \"ImageDefault\"\r\n }\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_gallery_image_version_vhd000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic\"}]},\r\n - \ \"provisioningState\": \"Succeeded\"\r\n }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '2671' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:26:40 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;31941 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - sig create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name - User-Agent: - - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.1.0 Azure-SDK-For-Python AZURECLI/2.22.0 - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001?api-version=2020-10-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001","name":"cli_test_gallery_image_version_vhd000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2021-04-20T05:24:29Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '428' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:26:41 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: '{"location": "westus", "tags": {}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - sig create - Connection: - - keep-alive - Content-Length: - - '34' - Content-Type: - - application/json - ParameterSetName: - - -g --gallery-name - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002?api-version=2019-12-01 - response: - body: - string: "{\r\n \"name\": \"gallery_000002\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002\",\r\n - \ \"type\": \"Microsoft.Compute/galleries\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {},\r\n \"properties\": {\r\n \"identifier\": {\r\n \"uniqueName\": - \"0b1f6471-1bf0-4dda-aec3-cb9272f09590-GALLERY_RNKN6O7K5EID\"\r\n },\r\n - \ \"provisioningState\": \"Creating\"\r\n }\r\n}" - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/4d170a45-3f80-4c20-b572-56ba7012fc46?api-version=2019-12-01 - cache-control: - - no-cache - content-length: - - '506' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:26:47 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/CreateUpdateGallery3Min;49,Microsoft.Compute/CreateUpdateGallery30Min;299 - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/4d170a45-3f80-4c20-b572-56ba7012fc46?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:26:46.14376+00:00\",\r\n \"endTime\": - \"2021-04-20T05:26:47.0031535+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"4d170a45-3f80-4c20-b572-56ba7012fc46\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '182' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:27: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/GetOperationStatus3Min;1198,Microsoft.Compute/GetOperationStatus30Min;4198 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002?api-version=2019-12-01 - response: - body: - string: "{\r\n \"name\": \"gallery_000002\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002\",\r\n - \ \"type\": \"Microsoft.Compute/galleries\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {},\r\n \"properties\": {\r\n \"identifier\": {\r\n \"uniqueName\": - \"0b1f6471-1bf0-4dda-aec3-cb9272f09590-GALLERY_RNKN6O7K5EID\"\r\n },\r\n - \ \"provisioningState\": \"Succeeded\"\r\n }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '507' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:27: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/GetGallery3Min;346,Microsoft.Compute/GetGallery30Min;2496 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-definition create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --os-type -p -f -s - User-Agent: - - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.1.0 Azure-SDK-For-Python AZURECLI/2.22.0 - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001?api-version=2020-10-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001","name":"cli_test_gallery_image_version_vhd000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2021-04-20T05:24:29Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '428' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:27:17 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: '{"location": "westus", "tags": {}, "properties": {"osType": "Linux", "osState": - "Generalized", "hyperVGeneration": "V1", "identifier": {"publisher": "publisher1", - "offer": "offer1", "sku": "sku1"}, "disallowed": {}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-definition create - Connection: - - keep-alive - Content-Length: - - '216' - Content-Type: - - application/json - ParameterSetName: - - -g --gallery-name --gallery-image-definition --os-type -p -f -s - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002/images/image1?api-version=2020-09-30 - response: - body: - string: "{\r\n \"name\": \"image1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002/images/image1\",\r\n - \ \"type\": \"Microsoft.Compute/galleries/images\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {},\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n - \ \"osType\": \"Linux\",\r\n \"osState\": \"Generalized\",\r\n \"identifier\": - {\r\n \"publisher\": \"publisher1\",\r\n \"offer\": \"offer1\",\r\n - \ \"sku\": \"sku1\"\r\n },\r\n \"provisioningState\": \"Creating\"\r\n - \ }\r\n}" - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/3f0810dd-3ac9-43cb-a245-1e40a785c714?api-version=2020-09-30 - cache-control: - - no-cache - content-length: - - '599' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:27:24 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/CreateUpdateGalleryImage3Min;149,Microsoft.Compute/CreateUpdateGalleryImage30Min;749 - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-definition create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --os-type -p -f -s - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/3f0810dd-3ac9-43cb-a245-1e40a785c714?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:27:23.223348+00:00\",\r\n \"endTime\": - \"2021-04-20T05:27:23.348404+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"3f0810dd-3ac9-43cb-a245-1e40a785c714\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '182' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:27: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/GetOperationStatus3Min;1196,Microsoft.Compute/GetOperationStatus30Min;4196 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-definition create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --os-type -p -f -s - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002/images/image1?api-version=2020-09-30 - response: - body: - string: "{\r\n \"name\": \"image1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002/images/image1\",\r\n - \ \"type\": \"Microsoft.Compute/galleries/images\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {},\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n - \ \"osType\": \"Linux\",\r\n \"osState\": \"Generalized\",\r\n \"identifier\": - {\r\n \"publisher\": \"publisher1\",\r\n \"offer\": \"offer1\",\r\n - \ \"sku\": \"sku1\"\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n - \ }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '600' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:27: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/GetGalleryImage3Min;596,Microsoft.Compute/GetGalleryImage30Min;2996 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - python/3.7.9 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.1.0 Azure-SDK-For-Python AZURECLI/2.22.0 - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_gallery_image_version_vhd000001?api-version=2020-10-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001","name":"cli_test_gallery_image_version_vhd000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2021-04-20T05:24:29Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '428' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:27:55 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: '{"location": "westus", "tags": {}, "properties": {"publishingProfile": - {"targetRegions": [{"name": "westus"}], "replicaCount": 1}, "storageProfile": - {"osDiskImage": {"source": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Storage/storageAccounts/vhdstoragef1f251d35a243e", - "uri": "https://vhdstoragef1f251d35a243e.blob.core.windows.net/vhds/osdisk_f1f251d35a.vhd"}}}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - Content-Length: - - '493' - Content-Type: - - application/json - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002/images/image1/versions/1.0.0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"name\": \"1.0.0\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002/images/image1/versions/1.0.0\",\r\n - \ \"type\": \"Microsoft.Compute/galleries/images/versions\",\r\n \"location\": - \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"publishingProfile\": - {\r\n \"targetRegions\": [\r\n {\r\n \"name\": \"West - US\",\r\n \"regionalReplicaCount\": 1,\r\n \"storageAccountType\": - \"Standard_LRS\"\r\n }\r\n ],\r\n \"replicaCount\": 1,\r\n - \ \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n - \ \"storageAccountType\": \"Standard_LRS\"\r\n },\r\n \"storageProfile\": - {\r\n \"osDiskImage\": {\r\n \"hostCaching\": \"ReadWrite\",\r\n - \ \"source\": {\r\n \"uri\": \"https://vhdstoragef1f251d35a243e.blob.core.windows.net/vhds/osdisk_f1f251d35a.vhd\",\r\n - \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Storage/storageAccounts/vhdstoragef1f251d35a243e\"\r\n - \ }\r\n }\r\n },\r\n \"provisioningState\": \"Creating\"\r\n - \ }\r\n}" - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/dfc5ae92-314e-4413-910b-348518f3d9b0?api-version=2020-09-30 - cache-control: - - no-cache - content-length: - - '1271' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:28:02 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/CreateUpdateGalleryImageVersion3Min;374,Microsoft.Compute/CreateUpdateGalleryImageVersion30Min;1199 - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/dfc5ae92-314e-4413-910b-348518f3d9b0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"dfc5ae92-314e-4413-910b-348518f3d9b0\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:29: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/GetOperationStatus3Min;1194,Microsoft.Compute/GetOperationStatus30Min;4194 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/dfc5ae92-314e-4413-910b-348518f3d9b0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"dfc5ae92-314e-4413-910b-348518f3d9b0\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:30: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/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4193 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/dfc5ae92-314e-4413-910b-348518f3d9b0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"dfc5ae92-314e-4413-910b-348518f3d9b0\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:31: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/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4191 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/dfc5ae92-314e-4413-910b-348518f3d9b0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"dfc5ae92-314e-4413-910b-348518f3d9b0\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:32: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/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4189 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/dfc5ae92-314e-4413-910b-348518f3d9b0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"dfc5ae92-314e-4413-910b-348518f3d9b0\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:33:05 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/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4187 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/dfc5ae92-314e-4413-910b-348518f3d9b0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"dfc5ae92-314e-4413-910b-348518f3d9b0\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:34:06 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/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4185 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/dfc5ae92-314e-4413-910b-348518f3d9b0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"dfc5ae92-314e-4413-910b-348518f3d9b0\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:35:06 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/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4183 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/dfc5ae92-314e-4413-910b-348518f3d9b0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n \"status\": - \"InProgress\",\r\n \"name\": \"dfc5ae92-314e-4413-910b-348518f3d9b0\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:36:07 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/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4181 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/capsOperations/dfc5ae92-314e-4413-910b-348518f3d9b0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"startTime\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n \"endTime\": - \"2021-04-20T05:36:32.0882526+00:00\",\r\n \"status\": \"Succeeded\",\r\n - \ \"name\": \"dfc5ae92-314e-4413-910b-348518f3d9b0\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '184' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:37:08 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/GetOperationStatus3Min;1195,Microsoft.Compute/GetOperationStatus30Min;4179 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - sig image-version create - Connection: - - keep-alive - ParameterSetName: - - -g --gallery-name --gallery-image-definition --gallery-image-version --os-vhd-uri - --os-vhd-storage-account --replica-count - User-Agent: - - AZURECLI/2.22.0 azsdk-python-azure-mgmt-compute/20.0.0 Python/3.7.9 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002/images/image1/versions/1.0.0?api-version=2020-09-30 - response: - body: - string: "{\r\n \"name\": \"1.0.0\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Compute/galleries/gallery_000002/images/image1/versions/1.0.0\",\r\n - \ \"type\": \"Microsoft.Compute/galleries/images/versions\",\r\n \"location\": - \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"publishingProfile\": - {\r\n \"targetRegions\": [\r\n {\r\n \"name\": \"West - US\",\r\n \"regionalReplicaCount\": 1,\r\n \"storageAccountType\": - \"Standard_LRS\"\r\n }\r\n ],\r\n \"replicaCount\": 1,\r\n - \ \"excludeFromLatest\": false,\r\n \"publishedDate\": \"2021-04-20T05:28:01.2560728+00:00\",\r\n - \ \"storageAccountType\": \"Standard_LRS\"\r\n },\r\n \"storageProfile\": - {\r\n \"osDiskImage\": {\r\n \"hostCaching\": \"ReadWrite\",\r\n - \ \"source\": {\r\n \"uri\": \"https://vhdstoragef1f251d35a243e.blob.core.windows.net/vhds/osdisk_f1f251d35a.vhd\",\r\n - \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_gallery_image_version_vhd000001/providers/Microsoft.Storage/storageAccounts/vhdstoragef1f251d35a243e\"\r\n - \ }\r\n }\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n - \ }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '1272' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 20 Apr 2021 05:37:08 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/GetGalleryImageVersion3Min;1999,Microsoft.Compute/GetGalleryImageVersion30Min;9997 - status: - code: 200 - message: OK -version: 1 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 f8ad41bc0be..aaa128cf37d 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 @@ -3823,23 +3823,46 @@ def test_gallery_e2e(self, resource_group, resource_group_location): self.cmd('sig image-definition delete -g {rg} --gallery-name {gallery} --gallery-image-definition {image}') self.cmd('sig delete -g {rg} --gallery-name {gallery}') + @unittest.skip('Service failed') + @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_gallery_image_version_vhd') - def test_gallery_image_version_vhd(self, resource_group): + @StorageAccountPreparer() + def test_gallery_image_version_vhd(self, resource_group, storage_account, storage_account_info): self.kwargs.update({ 'gallery': self.create_random_name(prefix='gallery_', length=20), + 'account_key': storage_account_info[1] }) self.cmd('vm create -g {rg} -n vm1 --image centos --use-unmanaged-disk --nsg-rule NONE --generate-ssh-key') vhd_uri = self.cmd('vm show -g {rg} -n vm1').get_output_in_json()['storageProfile']['osDisk']['vhd']['uri'] - storage_account = vhd_uri.split('.')[0].split('/')[-1] + storage_account_os = vhd_uri.split('.')[0].split('/')[-1] self.kwargs.update({ 'vhd': vhd_uri, - 'stac': storage_account + 'stac': storage_account_os + }) + + local_file_1 = self.create_temp_file(1024 * 1024) + local_file_2 = self.create_temp_file(1024 * 1024) + + self.cmd('storage container create -n container1 --account-name {sa} --account-key {account_key} --public-access container') + self.cmd('storage blob upload -c container1 --account-name {} -f "{}" -n file1.vhd --type page'.format(storage_account, local_file_1)) + self.cmd('storage blob upload -c container1 --account-name {} -f "{}" -n file2.vhd --type page'.format(storage_account, local_file_2)) + + vhd1_uri = 'https://{}.blob.core.windows.net/container1/file1.vhd'.format(storage_account) + vhd2_uri = 'https://{}.blob.core.windows.net/container1/file2.vhd'.format(storage_account) + self.kwargs.update({ + 'vhd1': vhd1_uri, + 'vhd2': vhd2_uri }) + self.cmd('sig create -g {rg} --gallery-name {gallery}') self.cmd('sig image-definition create -g {rg} --gallery-name {gallery} --gallery-image-definition image1 --os-type linux -p publisher1 -f offer1 -s sku1') - self.cmd('sig image-version create -g {rg} --gallery-name {gallery} --gallery-image-definition image1 --gallery-image-version 1.0.0 --os-vhd-uri {vhd} --os-vhd-storage-account {stac} --replica-count 1', checks=[ - self.check('storageProfile.osDiskImage.source.uri', vhd_uri) + self.cmd('sig image-version create -g {rg} --gallery-name {gallery} --gallery-image-definition image1 --gallery-image-version 1.0.0 --os-vhd-uri {vhd} --os-vhd-storage-account {stac} --data-vhds-uris {vhd1} {vhd2} --data-vhds-luns 0 1 --data-vhds-storage-accounts {sa} {sa} --replica-count 1', checks=[ + self.check('storageProfile.osDiskImage.source.uri', vhd_uri), + self.check('storageProfile.dataDiskImages[0].source.uri', vhd1_uri), + self.check('storageProfile.dataDiskImages[1].source.uri', vhd2_uri), + self.check('storageProfile.dataDiskImages[0].lun', 0), + self.check('storageProfile.dataDiskImages[1].lun', 1), ]) @ResourceGroupPreparer(name_prefix='cli_test_gallery_specialized_', location='eastus2')