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 b50c0f71440..735e188ec72 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_help.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_help.py @@ -1081,6 +1081,9 @@ supported-profiles: latest text: > az vm create -n MyVm -g MyResourceGroup --image Centos --zone 1 + - name: Create multiple VMs. In this example, 3 VMs are created. They are MyVm0, MyVm1, MyVm2. + text: > + az vm create -n MyVm -g MyResourceGroup --image centos --count 3 """ helps['vm deallocate'] = """ 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 ae227d21d9d..af85483e075 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_params.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_params.py @@ -347,6 +347,8 @@ def load_arguments(self, _): c.argument('enable_hotpatching', arg_type=get_three_state_flag(), help='Patch VMs without requiring a reboot. --enable-agent must be set and --patch-mode must be set to AutomaticByPlatform', min_api='2020-12-01') c.argument('platform_fault_domain', min_api='2020-06-01', help='Specify the scale set logical fault domain into which the virtual machine will be created. By default, the virtual machine will be automatically assigned to a fault domain that best maintains balance across available fault domains. This is applicable only if the virtualMachineScaleSet property of this virtual machine is set. The virtual machine scale set that is referenced, must have platform fault domain count. This property cannot be updated once the virtual machine is created. Fault domain assignment can be viewed in the virtual machine instance view') + c.argument('count', type=int, is_preview=True, + help='Number of virtual machines to create. Value range is [2, 250], inclusive. Don\'t specify this parameter if you want to create a normal single VM. The VMs are created in parallel. The output of this command is an array of VMs instead of one single VM. Each VM has its own public IP, NIC. VNET and NSG are shared. It is recommended that no existing public IP, NIC, VNET and NSG are in resource group. When --count is specified, --attach-data-disks, --attach-os-disk, --boot-diagnostics-storage, --computer-name, --host, --host-group, --nics, --os-disk-name, --private-ip-address, --public-ip-address, --public-ip-address-dns-name, --storage-account, --storage-container-name, --subnet, --use-unmanaged-disk, --vnet-name are not allowed.') with self.argument_context('vm create', arg_group='Storage') as c: c.argument('attach_os_disk', help='Attach an existing OS disk to the VM. Can use the name or ID of a managed disk or the URI to an unmanaged disk VHD.') diff --git a/src/azure-cli/azure/cli/command_modules/vm/_template_builder.py b/src/azure-cli/azure/cli/command_modules/vm/_template_builder.py index 21e101cbbd3..356f3f7331d 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_template_builder.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_template_builder.py @@ -78,7 +78,7 @@ def build_storage_account_resource(_, name, location, tags, sku): return storage_account -def build_public_ip_resource(cmd, name, location, tags, address_allocation, dns_name, sku, zone): +def build_public_ip_resource(cmd, name, location, tags, address_allocation, dns_name, sku, zone, count=None): public_ip_properties = {'publicIPAllocationMethod': address_allocation} if dns_name: @@ -94,6 +94,14 @@ def build_public_ip_resource(cmd, name, location, tags, address_allocation, dns_ 'properties': public_ip_properties } + if count: + public_ip['name'] = "[concat('{}', copyIndex())]".format(name) + public_ip['copy'] = { + 'name': 'publicipcopy', + 'mode': 'parallel', + 'count': count + } + # when multiple zones are provided(through a x-zone scale set), we don't propagate to PIP becasue it doesn't # support x-zone; rather we will rely on the Standard LB to work with such scale sets if zone and len(zone) == 1: @@ -105,8 +113,8 @@ def build_public_ip_resource(cmd, name, location, tags, address_allocation, dns_ def build_nic_resource(_, name, location, tags, vm_name, subnet_id, private_ip_address=None, - nsg_id=None, public_ip_id=None, application_security_groups=None, accelerated_networking=None): - + nsg_id=None, public_ip_id=None, application_security_groups=None, accelerated_networking=None, + count=None): private_ip_allocation = 'Static' if private_ip_address else 'Dynamic' ip_config_properties = { 'privateIPAllocationMethod': private_ip_allocation, @@ -118,15 +126,20 @@ def build_nic_resource(_, name, location, tags, vm_name, subnet_id, private_ip_a if public_ip_id: ip_config_properties['publicIPAddress'] = {'id': public_ip_id} + if count: + ip_config_properties['publicIPAddress']['id'] = "[concat('{}', copyIndex())]".format(public_ip_id) + ipconfig_name = 'ipconfig{}'.format(vm_name) nic_properties = { 'ipConfigurations': [ { - 'name': 'ipconfig{}'.format(vm_name), + 'name': ipconfig_name, 'properties': ip_config_properties } ] } + if count: + nic_properties['ipConfigurations'][0]['name'] = "[concat('{}', copyIndex())]".format(ipconfig_name) if nsg_id: nic_properties['networkSecurityGroup'] = {'id': nsg_id} @@ -150,6 +163,15 @@ def build_nic_resource(_, name, location, tags, vm_name, subnet_id, private_ip_a 'dependsOn': [], 'properties': nic_properties } + + if count: + nic['name'] = "[concat('{}', copyIndex())]".format(name) + nic['copy'] = { + 'name': 'niccopy', + 'mode': 'parallel', + 'count': count + } + return nic @@ -256,7 +278,7 @@ def build_vm_resource( # pylint: disable=too-many-locals, too-many-statements computer_name=None, dedicated_host=None, priority=None, max_price=None, eviction_policy=None, enable_agent=None, vmss=None, os_disk_encryption_set=None, data_disk_encryption_sets=None, specialized=None, encryption_at_host=None, dedicated_host_group=None, enable_auto_update=None, patch_mode=None, - enable_hotpatching=None, platform_fault_domain=None): + enable_hotpatching=None, platform_fault_domain=None, count=None): os_caching = disk_info['os'].get('caching') @@ -264,12 +286,18 @@ def _build_os_profile(): special_chars = '`~!@#$%^&*()=+_[]{}\\|;:\'\",<>/?' + # _computer_name is used to avoid shadow names + _computer_name = computer_name or ''.join(filter(lambda x: x not in special_chars, name)) + os_profile = { # Use name as computer_name if it's not provided. Remove special characters from name. - 'computerName': computer_name or ''.join(filter(lambda x: x not in special_chars, name)), + 'computerName': _computer_name, 'adminUsername': admin_username } + if count: + os_profile['computerName'] = "[concat('{}', copyIndex())]".format(_computer_name) + if admin_password: os_profile['adminPassword'] = "[parameters('adminPassword')]" @@ -490,6 +518,13 @@ def _build_storage_profile(): } if zone: vm['zones'] = zone + if count: + vm['copy'] = { + 'name': 'vmcopy', + 'mode': 'parallel', + 'count': count + } + vm['name'] = "[concat('{}', copyIndex())]".format(name) return vm diff --git a/src/azure-cli/azure/cli/command_modules/vm/_validators.py b/src/azure-cli/azure/cli/command_modules/vm/_validators.py index 71dcf2c4684..c63687d8d74 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_validators.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_validators.py @@ -1176,6 +1176,8 @@ def _resolve_role_id(cli_ctx, role, scope): def process_vm_create_namespace(cmd, namespace): validate_tags(namespace) _validate_location(cmd, namespace, namespace.zone, namespace.size) + if namespace.count is not None: + _validate_count(namespace) validate_asg_names_or_ids(cmd, namespace) _validate_vm_create_storage_profile(cmd, namespace) if namespace.storage_profile in [StorageProfile.SACustomImage, @@ -1760,3 +1762,46 @@ def _validate_vmss_create_host_group(cmd, namespace): subscription=get_subscription_id(cmd.cli_ctx), resource_group=namespace.resource_group_name, namespace='Microsoft.Compute', type='hostGroups', name=namespace.host_group ) + + +def _validate_count(namespace): + if namespace.count < 2 or namespace.count > 250: + raise ValidationError('--count should be in [2, 250]') + banned_params = [ + namespace.attach_data_disks, + namespace.attach_os_disk, + namespace.boot_diagnostics_storage, + namespace.computer_name, + namespace.dedicated_host, + namespace.dedicated_host_group, + namespace.nics, + namespace.os_disk_name, + namespace.private_ip_address, + namespace.public_ip_address, + namespace.public_ip_address_dns_name, + namespace.storage_account, + namespace.storage_container_name, + namespace.subnet, + namespace.use_unmanaged_disk, + namespace.vnet_name + ] + params_str = [ + '--attach-data-disks', + '--attach-os-disk', + '--boot-diagnostics-storage', + '--computer-name', + '--host', + '--host-group', + '--nics', + '--os-disk-name', + '--private-ip-address', + '--public-ip-address', + '--public-ip-address-dns-name', + '--storage-account', + '--storage-container-name', + '--subnet', + '--use-unmanaged-disk', + '--vnet-name' + ] + if any(param for param in banned_params): + raise ValidationError('When --count is specified, {} are not allowed'.format(', '.join(params_str))) diff --git a/src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py b/src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py index 7b6443ab28d..8bb782f0d6e 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py @@ -6,6 +6,9 @@ import json import os import re + +from azure.cli.core.commands.arm import ArmTemplateBuilder + try: from urllib.parse import urlparse except ImportError: @@ -352,3 +355,10 @@ def _update(info, lun, value): except ValueError: raise CLIError("A sku ID is incorrect.\n{}".format(usage_msg)) _update(info_dict, lun, value) + + +class ArmTemplateBuilder20190401(ArmTemplateBuilder): + + def __init__(self): + super().__init__() + self.template['$schema'] = 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' 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 181cd1a51d4..9bb090b3a36 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/custom.py +++ b/src/azure-cli/azure/cli/command_modules/vm/custom.py @@ -722,7 +722,7 @@ def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_DS1_ priority=None, max_price=None, eviction_policy=None, enable_agent=None, workspace=None, vmss=None, os_disk_encryption_set=None, data_disk_encryption_sets=None, specialized=None, encryption_at_host=None, enable_auto_update=None, patch_mode=None, ssh_key_name=None, - enable_hotpatching=None, platform_fault_domain=None): + enable_hotpatching=None, platform_fault_domain=None, count=None): from azure.cli.core.commands.client_factory import get_subscription_id from azure.cli.core.util import random_string, hash_string from azure.cli.core.commands.arm import ArmTemplateBuilder @@ -733,6 +733,7 @@ def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_DS1_ build_msi_role_assignment, build_vm_linux_log_analytics_workspace_agent, build_vm_windows_log_analytics_workspace_agent) + from azure.cli.command_modules.vm._vm_utils import ArmTemplateBuilder20190401 from msrestazure.tools import resource_id, is_valid_resource_id, parse_resource_id subscription_id = get_subscription_id(cmd.cli_ctx) @@ -766,7 +767,10 @@ def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_DS1_ storage_container_name = storage_container_name or 'vhds' # Build up the ARM template - master_template = ArmTemplateBuilder() + if count is None: + master_template = ArmTemplateBuilder() + else: + master_template = ArmTemplateBuilder20190401() vm_dependencies = [] if storage_account_type == 'new': @@ -779,7 +783,11 @@ def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_DS1_ nic_name = None if nic_type == 'new': nic_name = '{}VMNic'.format(vm_name) - vm_dependencies.append('Microsoft.Network/networkInterfaces/{}'.format(nic_name)) + nic_full_name = 'Microsoft.Network/networkInterfaces/{}'.format(nic_name) + if count: + vm_dependencies.extend([nic_full_name + str(i) for i in range(count)]) + else: + vm_dependencies.append(nic_full_name) nic_dependencies = [] if vnet_type == 'new': @@ -824,12 +832,15 @@ def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_DS1_ if public_ip_address_type == 'new': public_ip_address = public_ip_address or '{}PublicIP'.format(vm_name) - nic_dependencies.append('Microsoft.Network/publicIpAddresses/{}'.format( - public_ip_address)) + public_ip_address_full_name = 'Microsoft.Network/publicIpAddresses/{}'.format(public_ip_address) + if count: + nic_dependencies.extend([public_ip_address_full_name + str(i) for i in range(count)]) + else: + nic_dependencies.append(public_ip_address_full_name) master_template.add_resource(build_public_ip_resource(cmd, public_ip_address, location, tags, public_ip_address_allocation, public_ip_address_dns_name, - public_ip_sku, zone)) + public_ip_sku, zone, count)) subnet_id = subnet if is_valid_resource_id(subnet) else \ '{}/virtualNetworks/{}/subnets/{}'.format(network_id_template, vnet_name, subnet) @@ -844,12 +855,21 @@ def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_DS1_ public_ip_address_id = public_ip_address if is_valid_resource_id(public_ip_address) \ else '{}/publicIPAddresses/{}'.format(network_id_template, public_ip_address) - nics = [ - {'id': '{}/networkInterfaces/{}'.format(network_id_template, nic_name)} - ] + nics_id = '{}/networkInterfaces/{}'.format(network_id_template, nic_name) + + if count: + nics = [ + {'id': "[concat('{}', copyIndex())]".format(nics_id)} + ] + else: + nics = [ + {'id': nics_id} + ] + nic_resource = build_nic_resource( cmd, nic_name, location, tags, vm_name, subnet_id, private_ip_address, nsg_id, - public_ip_address_id, application_security_groups, accelerated_networking=accelerated_networking) + public_ip_address_id, application_security_groups, accelerated_networking=accelerated_networking, + count=count) nic_resource['dependsOn'] = nic_dependencies master_template.add_resource(nic_resource) else: @@ -895,7 +915,7 @@ def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_DS1_ data_disk_encryption_sets=data_disk_encryption_sets, specialized=specialized, encryption_at_host=encryption_at_host, dedicated_host_group=dedicated_host_group, enable_auto_update=enable_auto_update, patch_mode=patch_mode, enable_hotpatching=enable_hotpatching, - platform_fault_domain=platform_fault_domain) + platform_fault_domain=platform_fault_domain, count=count) vm_resource['dependsOn'] = vm_dependencies @@ -969,18 +989,28 @@ def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_DS1_ return sdk_no_wait(no_wait, client.create_or_update, resource_group_name, deployment_name, properties) LongRunningOperation(cmd.cli_ctx)(client.create_or_update(resource_group_name, deployment_name, properties)) - vm = get_vm_details(cmd, resource_group_name, vm_name) - if assign_identity is not None: - if enable_local_identity and not identity_scope: - _show_missing_access_warning(resource_group_name, vm_name, 'vm') - setattr(vm, 'identity', _construct_identity_info(identity_scope, identity_role, vm.identity.principal_id, - vm.identity.user_assigned_identities)) + if count: + vm_names = [vm_name + str(i) for i in range(count)] + else: + vm_names = [vm_name] + vms = [] + # Use vm_name2 to avoid R1704: Redefining argument with the local name 'vm_name' (redefined-argument-from-local) + for vm_name2 in vm_names: + vm = get_vm_details(cmd, resource_group_name, vm_name2) + if assign_identity is not None: + if enable_local_identity and not identity_scope: + _show_missing_access_warning(resource_group_name, vm_name2, 'vm') + setattr(vm, 'identity', _construct_identity_info(identity_scope, identity_role, vm.identity.principal_id, + vm.identity.user_assigned_identities)) + vms.append(vm) if workspace is not None: workspace_name = parse_resource_id(workspace_id)['name'] _set_data_source_for_workspace(cmd, os_type, resource_group_name, workspace_name) - return vm + if len(vms) == 1: + return vms[0] + return vms def auto_shutdown_vm(cmd, resource_group_name, vm_name, off=None, email=None, webhook=None, time=None, diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_create_count.yaml b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_create_count.yaml new file mode 100644 index 00000000000..5649e53dedb --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_create_count.yaml @@ -0,0 +1,1363 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --count --nsg-rule --generate-ssh-keys + User-Agent: + - python/3.7.4 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_create_count_000001?api-version=2020-10-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001","name":"cli_test_vm_create_count_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2021-03-15T05:57:30Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:57:34 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: + - Mon, 15 Mar 2021 05:57:35 GMT + etag: + - W/"540044b4084c3c314537f1baa1770f248628b2bc9ba0328f1004c33862e049da" + expires: + - Mon, 15 Mar 2021 06:02:35 GMT + source-age: + - '165' + 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: + - 658b2c9c0cb67aa06eab33f2d7c3bc5d25be386b + x-frame-options: + - deny + x-github-request-id: + - 693A:7502:309D79:40D758:604D837C + x-served-by: + - cache-sin18023-SIN + x-timer: + - S1615787855.317735,VS0,VE1 + x-xss-protection: + - 1; mode=block + 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-network/17.1.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/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: + - Mon, 15 Mar 2021 05:57:35 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/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {}, "variables": {}, "resources": + [{"name": "vmVNET", "type": "Microsoft.Network/virtualNetworks", "location": + "westus", "apiVersion": "2015-06-15", "dependsOn": [], "tags": {}, "properties": + {"addressSpace": {"addressPrefixes": ["10.0.0.0/16"]}, "subnets": [{"name": + "vmSubnet", "properties": {"addressPrefix": "10.0.0.0/24"}}]}}, {"type": "Microsoft.Network/networkSecurityGroups", + "name": "vmNSG", "apiVersion": "2015-06-15", "location": "westus", "tags": {}, + "dependsOn": []}, {"apiVersion": "2018-01-01", "type": "Microsoft.Network/publicIPAddresses", + "name": "[concat(''vmPublicIP'', copyIndex())]", "location": "westus", "tags": + {}, "dependsOn": [], "properties": {"publicIPAllocationMethod": null}, "copy": + {"name": "publicipcopy", "count": 3}}, {"apiVersion": "2015-06-15", "type": + "Microsoft.Network/networkInterfaces", "name": "[concat(''vmVMNic'', copyIndex())]", + "location": "westus", "tags": {}, "dependsOn": ["Microsoft.Network/virtualNetworks/vmVNET", + "Microsoft.Network/networkSecurityGroups/vmNSG", "Microsoft.Network/publicIpAddresses/vmPublicIP0", + "Microsoft.Network/publicIpAddresses/vmPublicIP1", "Microsoft.Network/publicIpAddresses/vmPublicIP2"], + "properties": {"ipConfigurations": [{"name": "[concat(''ipconfigvm'', copyIndex())]", + "properties": {"privateIPAllocationMethod": "Dynamic", "subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET/subnets/vmSubnet"}, + "publicIPAddress": {"id": "[concat(''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP'', + copyIndex())]"}}}], "networkSecurityGroup": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG"}}, + "copy": {"name": "niccopy", "count": 3}}, {"apiVersion": "2020-12-01", "type": + "Microsoft.Compute/virtualMachines", "name": "[concat(''vm'', copyIndex())]", + "location": "westus", "tags": {}, "dependsOn": ["Microsoft.Network/networkInterfaces/vmVMNic0", + "Microsoft.Network/networkInterfaces/vmVMNic1", "Microsoft.Network/networkInterfaces/vmVMNic2"], + "properties": {"hardwareProfile": {"vmSize": "Standard_DS1_v2"}, "networkProfile": + {"networkInterfaces": [{"id": "[concat(''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic'', + copyIndex())]"}]}, "storageProfile": {"osDisk": {"createOption": "fromImage", + "name": null, "caching": "ReadWrite", "managedDisk": {"storageAccountType": + null}}, "imageReference": {"publisher": "OpenLogic", "offer": "CentOS", "sku": + "7.5", "version": "latest"}}, "osProfile": {"computerName": "[concat(''vm'', + copyIndex())]", "adminUsername": "fey", "linuxConfiguration": {"disablePasswordAuthentication": + true, "ssh": {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmzXeK++L20uMK/Ug5wpjnWWyMlHoecEOxyHueHc1gPDj8qgLChiHt1OWJ1sDjiqBJ+hEEwZLjN8lCmUvWzzrl20d7M/BVp1ejulE/zr999kWuY3m5+FpAkbbxeO9LWoafwOir9dPzIOjDGdPWKbgHr3SerOHAuvVdXJDhWHtW5lB/MEnrxi48Pz/8k1lD1YccUAI6zDgKVJPBEk9fWMW8H0hKYsRXmlxdtg2npBQK7kbmcB2NJPEhTVgxVPqSaBVAt2lOCC/QQvAXcoD0lJGujp1IVYqSUarS5RnrYEDZ9Q6EKduWrP0GFkFkF8YzpFe+BRFaV8bLJrvZN43vgzRj + fey@DESKTOP-ARGPJS4\n", "path": "/home/fey/.ssh/authorized_keys"}]}}}}, "copy": + {"name": "vmcopy", "count": 3}}], "outputs": {}}, "parameters": {}, "mode": + "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '3865' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --image --count --nsg-rule --generate-ssh-keys + User-Agent: + - python/3.7.4 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_create_count_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-10-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Resources/deployments/vm_deploy_6VJVPf8ghKc4pTq3mPVMMBaB3NXOnbqk","name":"vm_deploy_6VJVPf8ghKc4pTq3mPVMMBaB3NXOnbqk","type":"Microsoft.Resources/deployments","properties":{"templateHash":"17180818393530462103","parameters":{},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2021-03-15T05:57:40.4840703Z","duration":"PT2.4968741S","correlationId":"c258c576-5467-47e5-81f6-8259aa14b16e","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_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vmVNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vmNSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP0","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP1","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP2","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic0"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vmVNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vmNSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP0","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP1","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP2","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic1"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vmVNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vmNSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP0","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP1","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP2","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic2"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm0","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm0"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm1"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm2","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm2"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_create_count_000001/providers/Microsoft.Resources/deployments/vm_deploy_6VJVPf8ghKc4pTq3mPVMMBaB3NXOnbqk/operationStatuses/08585858190274904543?api-version=2020-10-01 + cache-control: + - no-cache + content-length: + - '9667' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:57:41 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - python/3.7.4 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_create_count_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585858190274904543?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: + - Mon, 15 Mar 2021 05:58:12 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - python/3.7.4 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_create_count_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585858190274904543?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: + - Mon, 15 Mar 2021 05:58:43 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - python/3.7.4 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_create_count_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585858190274904543?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: + - Mon, 15 Mar 2021 05:59:13 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - python/3.7.4 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_create_count_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585858190274904543?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: + - Mon, 15 Mar 2021 05:59:43 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - python/3.7.4 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_create_count_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2020-10-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Resources/deployments/vm_deploy_6VJVPf8ghKc4pTq3mPVMMBaB3NXOnbqk","name":"vm_deploy_6VJVPf8ghKc4pTq3mPVMMBaB3NXOnbqk","type":"Microsoft.Resources/deployments","properties":{"templateHash":"17180818393530462103","parameters":{},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2021-03-15T05:59:29.9302941Z","duration":"PT1M51.9430979S","correlationId":"c258c576-5467-47e5-81f6-8259aa14b16e","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_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vmVNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vmNSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP0","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP1","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP2","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic0"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vmVNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vmNSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP0","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP1","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP2","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic1"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vmVNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vmNSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP0","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP1","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP2","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmPublicIP2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic2"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm0","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm0"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm1"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vmVMNic2"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm2","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm2"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm2"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP2"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '11966' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59:43 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-compute/19.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm0?$expand=instanceView&api-version=2020-12-01 + response: + body: + string: "{\r\n \"name\": \"vm0\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm0\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"0bc0ab30-0b3e-41c0-bc7b-488fa2eff154\",\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\": + \"vm0_OsDisk_1_bf6a543468d14dcca754b42e10d4dd23\",\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_vm_create_count_000001/providers/Microsoft.Compute/disks/vm0_OsDisk_1_bf6a543468d14dcca754b42e10d4dd23\"\r\n + \ },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": + []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"vm0\",\r\n + \ \"adminUsername\": \"fey\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n + \ \"path\": \"/home/fey/.ssh/authorized_keys\",\r\n \"keyData\": + \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmzXeK++L20uMK/Ug5wpjnWWyMlHoecEOxyHueHc1gPDj8qgLChiHt1OWJ1sDjiqBJ+hEEwZLjN8lCmUvWzzrl20d7M/BVp1ejulE/zr999kWuY3m5+FpAkbbxeO9LWoafwOir9dPzIOjDGdPWKbgHr3SerOHAuvVdXJDhWHtW5lB/MEnrxi48Pz/8k1lD1YccUAI6zDgKVJPBEk9fWMW8H0hKYsRXmlxdtg2npBQK7kbmcB2NJPEhTVgxVPqSaBVAt2lOCC/QQvAXcoD0lJGujp1IVYqSUarS5RnrYEDZ9Q6EKduWrP0GFkFkF8YzpFe+BRFaV8bLJrvZN43vgzRj + fey@DESKTOP-ARGPJS4\\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_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"instanceView\": {\r\n \"computerName\": + \"vm0\",\r\n \"osName\": \"centos\",\r\n \"osVersion\": \"7.5.1804\",\r\n + \ \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.2.53.1\",\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-03-15T05:59:18+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": + []\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"vm0_OsDisk_1_bf6a543468d14dcca754b42e10d4dd23\",\r\n + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2021-03-15T05:58:07.3192843+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-03-15T05:59:15.4310025+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: + - '3832' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59: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/LowCostGet3Min;3987,Microsoft.Compute/LowCostGet30Min;31981 + 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-network/17.1.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0?api-version=2018-01-01 + response: + body: + string: "{\r\n \"name\": \"vmVMNic0\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0\",\r\n + \ \"etag\": \"W/\\\"5b964338-50c8-4d2f-b02b-6ef83c584694\\\"\",\r\n \"location\": + \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"94413c94-c685-4e09-89f6-744e2c507583\",\r\n + \ \"ipConfigurations\": [\r\n {\r\n \"name\": \"ipconfigvm0\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0/ipConfigurations/ipconfigvm0\",\r\n + \ \"etag\": \"W/\\\"5b964338-50c8-4d2f-b02b-6ef83c584694\\\"\",\r\n + \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateIPAddress\": \"10.0.0.6\",\r\n \"privateIPAllocationMethod\": + \"Dynamic\",\r\n \"publicIPAddress\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP0\"\r\n + \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET/subnets/vmSubnet\"\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\": + \"hi42fgollake1fzt322kfucrda.dx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": + \"00-22-48-03-A5-98\",\r\n \"enableAcceleratedNetworking\": false,\r\n + \ \"enableIPForwarding\": false,\r\n \"networkSecurityGroup\": {\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG\"\r\n + \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm0\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2565' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59:45 GMT + etag: + - W/"5b964338-50c8-4d2f-b02b-6ef83c584694" + 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: + - ffabe42b-891b-4153-bc76-c59b8d1e2b6d + 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-network/17.1.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP0?api-version=2018-01-01 + response: + body: + string: "{\r\n \"name\": \"vmPublicIP0\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP0\",\r\n + \ \"etag\": \"W/\\\"4aadc205-8985-4c79-92a5-15a2d213945c\\\"\",\r\n \"location\": + \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"9cadcb37-ade3-4c78-9a16-6b03fd9c96ca\",\r\n + \ \"ipAddress\": \"104.45.223.242\",\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_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0/ipConfigurations/ipconfigvm0\"\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: + - Mon, 15 Mar 2021 05:59:45 GMT + etag: + - W/"4aadc205-8985-4c79-92a5-15a2d213945c" + 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: + - 4fb25c72-841f-4957-97fb-9dcf624a5701 + 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-compute/19.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/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_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"1b23f7c2-b371-42d3-874b-02800e555e2a\",\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\": + \"vm1_OsDisk_1_04f95e53260d46d1bddf53477d02587a\",\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_vm_create_count_000001/providers/Microsoft.Compute/disks/vm1_OsDisk_1_04f95e53260d46d1bddf53477d02587a\"\r\n + \ },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": + []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"vm1\",\r\n + \ \"adminUsername\": \"fey\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n + \ \"path\": \"/home/fey/.ssh/authorized_keys\",\r\n \"keyData\": + \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmzXeK++L20uMK/Ug5wpjnWWyMlHoecEOxyHueHc1gPDj8qgLChiHt1OWJ1sDjiqBJ+hEEwZLjN8lCmUvWzzrl20d7M/BVp1ejulE/zr999kWuY3m5+FpAkbbxeO9LWoafwOir9dPzIOjDGdPWKbgHr3SerOHAuvVdXJDhWHtW5lB/MEnrxi48Pz/8k1lD1YccUAI6zDgKVJPBEk9fWMW8H0hKYsRXmlxdtg2npBQK7kbmcB2NJPEhTVgxVPqSaBVAt2lOCC/QQvAXcoD0lJGujp1IVYqSUarS5RnrYEDZ9Q6EKduWrP0GFkFkF8YzpFe+BRFaV8bLJrvZN43vgzRj + fey@DESKTOP-ARGPJS4\\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_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1\"}]},\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.53.1\",\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-03-15T05:59:42+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": + []\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"vm1_OsDisk_1_04f95e53260d46d1bddf53477d02587a\",\r\n + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2021-03-15T05:58:07.6317883+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-03-15T05:59:14.5716359+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: + - '3832' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59: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/LowCostGet3Min;3986,Microsoft.Compute/LowCostGet30Min;31980 + 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-network/17.1.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1?api-version=2018-01-01 + response: + body: + string: "{\r\n \"name\": \"vmVMNic1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1\",\r\n + \ \"etag\": \"W/\\\"987b4d1b-b7e2-4333-b1ce-53b72e514bc5\\\"\",\r\n \"location\": + \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"8dae5ced-86bb-45d5-a754-b9baa24e6aa0\",\r\n + \ \"ipConfigurations\": [\r\n {\r\n \"name\": \"ipconfigvm1\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1/ipConfigurations/ipconfigvm1\",\r\n + \ \"etag\": \"W/\\\"987b4d1b-b7e2-4333-b1ce-53b72e514bc5\\\"\",\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_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP1\"\r\n + \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET/subnets/vmSubnet\"\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\": + \"hi42fgollake1fzt322kfucrda.dx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": + \"00-22-48-03-AC-F4\",\r\n \"enableAcceleratedNetworking\": false,\r\n + \ \"enableIPForwarding\": false,\r\n \"networkSecurityGroup\": {\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG\"\r\n + \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm1\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2565' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59:47 GMT + etag: + - W/"987b4d1b-b7e2-4333-b1ce-53b72e514bc5" + 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: + - e8803900-7c61-45d0-9c6a-f4e6538365e0 + 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-network/17.1.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP1?api-version=2018-01-01 + response: + body: + string: "{\r\n \"name\": \"vmPublicIP1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP1\",\r\n + \ \"etag\": \"W/\\\"3bc6d41e-7d7b-4889-adbc-2ec3c47fc7d9\\\"\",\r\n \"location\": + \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"a113748c-f354-4bd4-859b-d7b7aa545b6d\",\r\n + \ \"ipAddress\": \"104.45.222.5\",\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_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1/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: + - '996' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59:47 GMT + etag: + - W/"3bc6d41e-7d7b-4889-adbc-2ec3c47fc7d9" + 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: + - 19767fc7-23ff-49ab-b921-6e1483091eda + 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-compute/19.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm2?$expand=instanceView&api-version=2020-12-01 + response: + body: + string: "{\r\n \"name\": \"vm2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm2\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"b09b94a6-88f5-4438-83bb-c14c3000bce0\",\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\": + \"vm2_OsDisk_1_3baf00b4f03045419faffcc34bc89a3c\",\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_vm_create_count_000001/providers/Microsoft.Compute/disks/vm2_OsDisk_1_3baf00b4f03045419faffcc34bc89a3c\"\r\n + \ },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": + []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"vm2\",\r\n + \ \"adminUsername\": \"fey\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n + \ \"path\": \"/home/fey/.ssh/authorized_keys\",\r\n \"keyData\": + \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmzXeK++L20uMK/Ug5wpjnWWyMlHoecEOxyHueHc1gPDj8qgLChiHt1OWJ1sDjiqBJ+hEEwZLjN8lCmUvWzzrl20d7M/BVp1ejulE/zr999kWuY3m5+FpAkbbxeO9LWoafwOir9dPzIOjDGdPWKbgHr3SerOHAuvVdXJDhWHtW5lB/MEnrxi48Pz/8k1lD1YccUAI6zDgKVJPBEk9fWMW8H0hKYsRXmlxdtg2npBQK7kbmcB2NJPEhTVgxVPqSaBVAt2lOCC/QQvAXcoD0lJGujp1IVYqSUarS5RnrYEDZ9Q6EKduWrP0GFkFkF8YzpFe+BRFaV8bLJrvZN43vgzRj + fey@DESKTOP-ARGPJS4\\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_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2\"}]},\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"instanceView\": {\r\n \"computerName\": + \"vm2\",\r\n \"osName\": \"centos\",\r\n \"osVersion\": \"7.5.1804\",\r\n + \ \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.2.53.1\",\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-03-15T05:59:31+00:00\"\r\n }\r\n ],\r\n \"extensionHandlers\": + []\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": \"vm2_OsDisk_1_3baf00b4f03045419faffcc34bc89a3c\",\r\n + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2021-03-15T05:58:08.7724078+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-03-15T05:59:28.6033502+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: + - '3832' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59:48 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;31979 + 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-network/17.1.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2?api-version=2018-01-01 + response: + body: + string: "{\r\n \"name\": \"vmVMNic2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2\",\r\n + \ \"etag\": \"W/\\\"d10200b9-e8d1-4e8d-90e3-3d4c4fbeab26\\\"\",\r\n \"location\": + \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"50f82dea-ff66-4732-8406-3cf8a50c23fd\",\r\n + \ \"ipConfigurations\": [\r\n {\r\n \"name\": \"ipconfigvm2\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2/ipConfigurations/ipconfigvm2\",\r\n + \ \"etag\": \"W/\\\"d10200b9-e8d1-4e8d-90e3-3d4c4fbeab26\\\"\",\r\n + \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateIPAddress\": \"10.0.0.5\",\r\n \"privateIPAllocationMethod\": + \"Dynamic\",\r\n \"publicIPAddress\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP2\"\r\n + \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/virtualNetworks/vmVNET/subnets/vmSubnet\"\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\": + \"hi42fgollake1fzt322kfucrda.dx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": + \"00-22-48-03-A4-8C\",\r\n \"enableAcceleratedNetworking\": false,\r\n + \ \"enableIPForwarding\": false,\r\n \"networkSecurityGroup\": {\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/networkSecurityGroups/vmNSG\"\r\n + \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm2\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2565' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59:49 GMT + etag: + - W/"d10200b9-e8d1-4e8d-90e3-3d4c4fbeab26" + 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: + - 1a5d95ae-a1ec-463f-967b-323208fa35a9 + 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 --count --nsg-rule --generate-ssh-keys + User-Agent: + - AZURECLI/2.20.0 azsdk-python-azure-mgmt-network/17.1.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP2?api-version=2018-01-01 + response: + body: + string: "{\r\n \"name\": \"vmPublicIP2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Network/publicIPAddresses/vmPublicIP2\",\r\n + \ \"etag\": \"W/\\\"eea61da6-00b0-47e5-90cc-f3c14fd47de9\\\"\",\r\n \"location\": + \"westus\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"94b17a08-08d5-495f-b2c7-e6b409342bbb\",\r\n + \ \"ipAddress\": \"104.45.215.170\",\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_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2/ipConfigurations/ipconfigvm2\"\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: + - Mon, 15 Mar 2021 05:59:49 GMT + etag: + - W/"eea61da6-00b0-47e5-90cc-f3c14fd47de9" + 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: + - 9cc648b8-3922-495e-aa13-9c95537ceae2 + 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.20.0 azsdk-python-azure-mgmt-compute/19.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm0?api-version=2020-12-01 + response: + body: + string: "{\r\n \"name\": \"vm0\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm0\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"0bc0ab30-0b3e-41c0-bc7b-488fa2eff154\",\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\": + \"vm0_OsDisk_1_bf6a543468d14dcca754b42e10d4dd23\",\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_vm_create_count_000001/providers/Microsoft.Compute/disks/vm0_OsDisk_1_bf6a543468d14dcca754b42e10d4dd23\"\r\n + \ },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": + []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"vm0\",\r\n + \ \"adminUsername\": \"fey\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n + \ \"path\": \"/home/fey/.ssh/authorized_keys\",\r\n \"keyData\": + \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmzXeK++L20uMK/Ug5wpjnWWyMlHoecEOxyHueHc1gPDj8qgLChiHt1OWJ1sDjiqBJ+hEEwZLjN8lCmUvWzzrl20d7M/BVp1ejulE/zr999kWuY3m5+FpAkbbxeO9LWoafwOir9dPzIOjDGdPWKbgHr3SerOHAuvVdXJDhWHtW5lB/MEnrxi48Pz/8k1lD1YccUAI6zDgKVJPBEk9fWMW8H0hKYsRXmlxdtg2npBQK7kbmcB2NJPEhTVgxVPqSaBVAt2lOCC/QQvAXcoD0lJGujp1IVYqSUarS5RnrYEDZ9Q6EKduWrP0GFkFkF8YzpFe+BRFaV8bLJrvZN43vgzRj + fey@DESKTOP-ARGPJS4\\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_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic0\"}]},\r\n + \ \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2535' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59:50 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;3984,Microsoft.Compute/LowCostGet30Min;31978 + 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.20.0 azsdk-python-azure-mgmt-compute/19.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/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_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"1b23f7c2-b371-42d3-874b-02800e555e2a\",\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\": + \"vm1_OsDisk_1_04f95e53260d46d1bddf53477d02587a\",\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_vm_create_count_000001/providers/Microsoft.Compute/disks/vm1_OsDisk_1_04f95e53260d46d1bddf53477d02587a\"\r\n + \ },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": + []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"vm1\",\r\n + \ \"adminUsername\": \"fey\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n + \ \"path\": \"/home/fey/.ssh/authorized_keys\",\r\n \"keyData\": + \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmzXeK++L20uMK/Ug5wpjnWWyMlHoecEOxyHueHc1gPDj8qgLChiHt1OWJ1sDjiqBJ+hEEwZLjN8lCmUvWzzrl20d7M/BVp1ejulE/zr999kWuY3m5+FpAkbbxeO9LWoafwOir9dPzIOjDGdPWKbgHr3SerOHAuvVdXJDhWHtW5lB/MEnrxi48Pz/8k1lD1YccUAI6zDgKVJPBEk9fWMW8H0hKYsRXmlxdtg2npBQK7kbmcB2NJPEhTVgxVPqSaBVAt2lOCC/QQvAXcoD0lJGujp1IVYqSUarS5RnrYEDZ9Q6EKduWrP0GFkFkF8YzpFe+BRFaV8bLJrvZN43vgzRj + fey@DESKTOP-ARGPJS4\\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_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic1\"}]},\r\n + \ \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2535' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59:50 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;31977 + 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.20.0 azsdk-python-azure-mgmt-compute/19.0.0 Python/3.7.4 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm2?api-version=2020-12-01 + response: + body: + string: "{\r\n \"name\": \"vm2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_create_count_000001/providers/Microsoft.Compute/virtualMachines/vm2\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"westus\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"vmId\": \"b09b94a6-88f5-4438-83bb-c14c3000bce0\",\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\": + \"vm2_OsDisk_1_3baf00b4f03045419faffcc34bc89a3c\",\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_vm_create_count_000001/providers/Microsoft.Compute/disks/vm2_OsDisk_1_3baf00b4f03045419faffcc34bc89a3c\"\r\n + \ },\r\n \"diskSizeGB\": 30\r\n },\r\n \"dataDisks\": + []\r\n },\r\n \"osProfile\": {\r\n \"computerName\": \"vm2\",\r\n + \ \"adminUsername\": \"fey\",\r\n \"linuxConfiguration\": {\r\n \"disablePasswordAuthentication\": + true,\r\n \"ssh\": {\r\n \"publicKeys\": [\r\n {\r\n + \ \"path\": \"/home/fey/.ssh/authorized_keys\",\r\n \"keyData\": + \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmzXeK++L20uMK/Ug5wpjnWWyMlHoecEOxyHueHc1gPDj8qgLChiHt1OWJ1sDjiqBJ+hEEwZLjN8lCmUvWzzrl20d7M/BVp1ejulE/zr999kWuY3m5+FpAkbbxeO9LWoafwOir9dPzIOjDGdPWKbgHr3SerOHAuvVdXJDhWHtW5lB/MEnrxi48Pz/8k1lD1YccUAI6zDgKVJPBEk9fWMW8H0hKYsRXmlxdtg2npBQK7kbmcB2NJPEhTVgxVPqSaBVAt2lOCC/QQvAXcoD0lJGujp1IVYqSUarS5RnrYEDZ9Q6EKduWrP0GFkFkF8YzpFe+BRFaV8bLJrvZN43vgzRj + fey@DESKTOP-ARGPJS4\\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_vm_create_count_000001/providers/Microsoft.Network/networkInterfaces/vmVMNic2\"}]},\r\n + \ \"provisioningState\": \"Succeeded\"\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2535' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 15 Mar 2021 05:59:51 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;31976 + 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 1133b324010..cad0ca3fd76 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 @@ -5072,5 +5072,14 @@ def test_vm_ssh_key(self, resource_group): self.cmd('sshkey show -g {rg} -n k3') +class VMCreateCountScenarioTest(ScenarioTest): + @ResourceGroupPreparer(name_prefix='cli_test_vm_create_count_') + def test_vm_create_count(self, resource_group): + self.cmd('vm create -g {rg} -n vm --image centos --count 3 --nsg-rule None --generate-ssh-keys') + self.cmd('vm show -g {rg} -n vm0') + self.cmd('vm show -g {rg} -n vm1') + self.cmd('vm show -g {rg} -n vm2') + + if __name__ == '__main__': unittest.main()