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 94b5b0c37ff..aeb928ada8b 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_params.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_params.py @@ -722,6 +722,8 @@ def load_arguments(self, _): c.argument('enable_vtpm', enable_vtpm_type) c.argument('os_disk_delete_option', arg_type=get_enum_type(self.get_models('DiskDeleteOptionTypes')), min_api='2022-03-01', arg_group='Storage', help='Specify whether OS disk should be deleted or detached upon VMSS Flex deletion (This feature is only for VMSS with flexible orchestration mode).') c.argument('data_disk_delete_option', arg_type=get_enum_type(self.get_models('DiskDeleteOptionTypes')), min_api='2022-03-01', arg_group='Storage', help='Specify whether data disk should be deleted or detached upon VMSS Flex deletion (This feature is only for VMSS with flexible orchestration mode)') + c.argument('max_surge', arg_type=get_three_state_flag(), min_api='2022-11-01', is_preview=True, + help='Specify it to create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines.') with self.argument_context('vmss create', arg_group='Network Balancer') as c: LoadBalancerSkuName = self.get_models('LoadBalancerSkuName', resource_type=ResourceType.MGMT_NETWORK) 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 a49c684d6a0..f1a2a371337 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 @@ -948,7 +948,7 @@ def build_vmss_resource(cmd, name, computer_name_prefix, location, tags, overpro v_cpus_per_core=None, os_disk_security_encryption_type=None, os_disk_secure_vm_disk_encryption_set=None, os_disk_delete_option=None, regular_priority_count=None, regular_priority_percentage=None, disk_controller_type=None, - enable_osimage_notification=None): + enable_osimage_notification=None, max_surge=None): # Build IP configuration ip_configuration = {} @@ -1284,6 +1284,9 @@ def build_vmss_resource(cmd, name, computer_name_prefix, location, tags, overpro if prioritize_unhealthy_instances is not None: rolling_upgrade_policy['prioritizeUnhealthyInstances'] = prioritize_unhealthy_instances + if max_surge is not None: + rolling_upgrade_policy['maxSurge'] = max_surge + if not rolling_upgrade_policy: del rolling_upgrade_policy 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 f7b97f5e652..c6b7ba95ab2 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/custom.py +++ b/src/azure-cli/azure/cli/command_modules/vm/custom.py @@ -3086,7 +3086,7 @@ def create_vmss(cmd, vmss_name, resource_group_name, image=None, os_disk_security_encryption_type=None, os_disk_secure_vm_disk_encryption_set=None, os_disk_delete_option=None, data_disk_delete_option=None, regular_priority_count=None, regular_priority_percentage=None, disk_controller_type=None, nat_rule_name=None, - enable_osimage_notification=None): + enable_osimage_notification=None, max_surge=None): from azure.cli.core.commands.client_factory import get_subscription_id from azure.cli.core.util import random_string, hash_string @@ -3396,7 +3396,7 @@ def _get_public_ip_address_allocation(value, sku): os_disk_secure_vm_disk_encryption_set=os_disk_secure_vm_disk_encryption_set, os_disk_delete_option=os_disk_delete_option, regular_priority_count=regular_priority_count, regular_priority_percentage=regular_priority_percentage, disk_controller_type=disk_controller_type, - enable_osimage_notification=enable_osimage_notification) + enable_osimage_notification=enable_osimage_notification, max_surge=max_surge) vmss_resource['dependsOn'] = vmss_dependencies diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_with_max_surge.yaml b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_with_max_surge.yaml new file mode 100644 index 00000000000..1b6cdd51fb2 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_with_max_surge.yaml @@ -0,0 +1,873 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vmss_with_max_surge000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001","name":"cli_test_vmss_with_max_surge000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2023-02-01T02:31:52Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '346' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:00 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.26.0 + method: GET + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + response: + body: + string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ + ,\n \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {},\n \"variables\"\ + : {},\n \"resources\": [],\n \"outputs\": {\n \"aliases\": {\n \"\ + type\": \"object\",\n \"value\": {\n \"Linux\": {\n \"\ + CentOS\": {\n \"publisher\": \"OpenLogic\",\n \"offer\"\ + : \"CentOS\",\n \"sku\": \"7.5\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"Debian\": {\n \"publisher\": \"Debian\",\n \"offer\"\ + : \"debian-10\",\n \"sku\": \"10\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"Flatcar\": {\n \"publisher\": \"kinvolk\",\n \"\ + offer\": \"flatcar-container-linux-free\",\n \"sku\": \"stable\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"openSUSE-Leap\": {\n \"publisher\"\ + : \"SUSE\",\n \"offer\": \"opensuse-leap-15-3\",\n \"\ + sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\"\ + : \"x64\"\n },\n \"RHEL\": {\n \"publisher\"\ + : \"RedHat\",\n \"offer\": \"RHEL\",\n \"sku\": \"7-LVM\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"SLES\": {\n \"publisher\": \"\ + SUSE\",\n \"offer\": \"sles-15-sp3\",\n \"sku\": \"\ + gen2\",\n \"version\": \"latest\",\n \"architecture\"\ + : \"x64\"\n },\n \"UbuntuLTS\": {\n \"publisher\"\ + : \"Canonical\",\n \"offer\": \"UbuntuServer\",\n \"\ + sku\": \"18.04-LTS\",\n \"version\": \"latest\",\n \"\ + architecture\": \"x64\"\n }\n },\n \"Windows\": {\n\ + \ \"Win2022Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\"\ + ,\n \"offer\": \"WindowsServer\",\n \"sku\": \"2022-Datacenter\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"Win2022AzureEditionCore\": {\n \ + \ \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\"\ + ,\n \"sku\": \"2022-datacenter-azure-edition-core\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n \ + \ },\n \"Win2019Datacenter\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2019-Datacenter\",\n \"version\": \"latest\"\ + ,\n \"architecture\": \"x64\"\n },\n \"Win2016Datacenter\"\ + : {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"\ + offer\": \"WindowsServer\",\n \"sku\": \"2016-Datacenter\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\ + \n },\n \"Win2012R2Datacenter\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2012-R2-Datacenter\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"Win2012Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\"\ + ,\n \"offer\": \"WindowsServer\",\n \"sku\": \"2012-Datacenter\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"Win2008R2SP1\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2008-R2-SP1\",\n \"version\": \"latest\"\ + ,\n \"architecture\": \"x64\"\n }\n }\n }\n\ + \ }\n }\n}" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - keep-alive + content-length: + - '3463' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:01 GMT + etag: + - W/"41b202f4dc5098d126019dc00721a4c5e30df0c5196794514fadc3710ee2a5cb" + expires: + - Wed, 01 Feb 2023 02:37:01 GMT + source-age: + - '0' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding,Origin + via: + - 1.1 varnish + x-cache: + - HIT + x-cache-hits: + - '1' + x-content-type-options: + - nosniff + x-fastly-request-id: + - 5b9ba8a9c81447bcfd148b37f60c364cc27172e1 + x-frame-options: + - deny + x-github-request-id: + - 7FA8:3498:98315:E0971:63D9B086 + x-served-by: + - cache-tyo11931-TYO + x-timer: + - S1675218721.391545,VS0,VE182 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-compute/29.1.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions?$top=1&$orderby=name%20desc&api-version=2022-11-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"18.04.202301310\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/westus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301310\"\ + \r\n }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '286' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15999,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43999 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-compute/29.1.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions/18.04.202301310?api-version=2022-11-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \ + \ \"architecture\": \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n\ + \ \"disallowed\": {\r\n \"vmDiskType\": \"None\"\r\n },\r\n \ + \ \"automaticOSUpgradeProperties\": {\r\n \"automaticOSUpgradeSupported\"\ + : true\r\n },\r\n \"imageDeprecationStatus\": {\r\n \"imageState\"\ + : \"Active\"\r\n },\r\n \"features\": [\r\n {\r\n \"name\"\ + : \"IsAcceleratedNetworkSupported\",\r\n \"value\": \"True\"\r\n \ + \ },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n \ + \ \"value\": \"SCSI, NVMe\"\r\n },\r\n {\r\n \"name\":\ + \ \"IsHibernateSupported\",\r\n \"value\": \"True\"\r\n }\r\n\ + \ ],\r\n \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\"\ + ,\r\n \"sizeInGb\": 31,\r\n \"sizeInBytes\": 32213303808\r\n \ + \ },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"westus\",\r\ + \n \"name\": \"18.04.202301310\",\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/westus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301310\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1048' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12999,Microsoft.Compute/GetVMImageFromLocation30Min;73999 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-network/21.0.1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/virtualNetworks?api-version=2022-01-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:04 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.26.0 + method: GET + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + response: + body: + string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\ + ,\n \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {},\n \"variables\"\ + : {},\n \"resources\": [],\n \"outputs\": {\n \"aliases\": {\n \"\ + type\": \"object\",\n \"value\": {\n \"Linux\": {\n \"\ + CentOS\": {\n \"publisher\": \"OpenLogic\",\n \"offer\"\ + : \"CentOS\",\n \"sku\": \"7.5\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"Debian\": {\n \"publisher\": \"Debian\",\n \"offer\"\ + : \"debian-10\",\n \"sku\": \"10\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"Flatcar\": {\n \"publisher\": \"kinvolk\",\n \"\ + offer\": \"flatcar-container-linux-free\",\n \"sku\": \"stable\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"openSUSE-Leap\": {\n \"publisher\"\ + : \"SUSE\",\n \"offer\": \"opensuse-leap-15-3\",\n \"\ + sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\"\ + : \"x64\"\n },\n \"RHEL\": {\n \"publisher\"\ + : \"RedHat\",\n \"offer\": \"RHEL\",\n \"sku\": \"7-LVM\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"SLES\": {\n \"publisher\": \"\ + SUSE\",\n \"offer\": \"sles-15-sp3\",\n \"sku\": \"\ + gen2\",\n \"version\": \"latest\",\n \"architecture\"\ + : \"x64\"\n },\n \"UbuntuLTS\": {\n \"publisher\"\ + : \"Canonical\",\n \"offer\": \"UbuntuServer\",\n \"\ + sku\": \"18.04-LTS\",\n \"version\": \"latest\",\n \"\ + architecture\": \"x64\"\n }\n },\n \"Windows\": {\n\ + \ \"Win2022Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\"\ + ,\n \"offer\": \"WindowsServer\",\n \"sku\": \"2022-Datacenter\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"Win2022AzureEditionCore\": {\n \ + \ \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\"\ + ,\n \"sku\": \"2022-datacenter-azure-edition-core\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n \ + \ },\n \"Win2019Datacenter\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2019-Datacenter\",\n \"version\": \"latest\"\ + ,\n \"architecture\": \"x64\"\n },\n \"Win2016Datacenter\"\ + : {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"\ + offer\": \"WindowsServer\",\n \"sku\": \"2016-Datacenter\",\n \ + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\ + \n },\n \"Win2012R2Datacenter\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2012-R2-Datacenter\",\n \"version\": \"\ + latest\",\n \"architecture\": \"x64\"\n },\n \ + \ \"Win2012Datacenter\": {\n \"publisher\": \"MicrosoftWindowsServer\"\ + ,\n \"offer\": \"WindowsServer\",\n \"sku\": \"2012-Datacenter\"\ + ,\n \"version\": \"latest\",\n \"architecture\": \"\ + x64\"\n },\n \"Win2008R2SP1\": {\n \"publisher\"\ + : \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n\ + \ \"sku\": \"2008-R2-SP1\",\n \"version\": \"latest\"\ + ,\n \"architecture\": \"x64\"\n }\n }\n }\n\ + \ }\n }\n}" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - keep-alive + content-length: + - '3463' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:05 GMT + etag: + - W/"41b202f4dc5098d126019dc00721a4c5e30df0c5196794514fadc3710ee2a5cb" + expires: + - Wed, 01 Feb 2023 02:37:05 GMT + source-age: + - '4' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding,Origin + via: + - 1.1 varnish + x-cache: + - HIT + x-cache-hits: + - '1' + x-content-type-options: + - nosniff + x-fastly-request-id: + - 7e2c8f978d3648c968ba74b4ce293e9dfb694039 + x-frame-options: + - deny + x-github-request-id: + - 7FA8:3498:98315:E0971:63D9B086 + x-served-by: + - cache-tyo11959-TYO + x-timer: + - S1675218726.597898,VS0,VE1 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-compute/29.1.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions?$top=1&$orderby=name%20desc&api-version=2022-11-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"18.04.202301310\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/westus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301310\"\ + \r\n }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '286' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15998,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43998 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-compute/29.1.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions/18.04.202301310?api-version=2022-11-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \ + \ \"architecture\": \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n\ + \ \"disallowed\": {\r\n \"vmDiskType\": \"None\"\r\n },\r\n \ + \ \"automaticOSUpgradeProperties\": {\r\n \"automaticOSUpgradeSupported\"\ + : true\r\n },\r\n \"imageDeprecationStatus\": {\r\n \"imageState\"\ + : \"Active\"\r\n },\r\n \"features\": [\r\n {\r\n \"name\"\ + : \"IsAcceleratedNetworkSupported\",\r\n \"value\": \"True\"\r\n \ + \ },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n \ + \ \"value\": \"SCSI, NVMe\"\r\n },\r\n {\r\n \"name\":\ + \ \"IsHibernateSupported\",\r\n \"value\": \"True\"\r\n }\r\n\ + \ ],\r\n \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\"\ + ,\r\n \"sizeInGb\": 31,\r\n \"sizeInBytes\": 32213303808\r\n \ + \ },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"westus\",\r\ + \n \"name\": \"18.04.202301310\",\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/westus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301310\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1048' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12998,Microsoft.Compute/GetVMImageFromLocation30Min;73998 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-compute/29.1.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions?$top=1&$orderby=name%20desc&api-version=2022-11-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"18.04.202301310\"\ + ,\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/westus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301310\"\ + \r\n }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '286' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15997,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43997 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-compute/29.1.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/UbuntuServer/skus/18.04-LTS/versions/18.04.202301310?api-version=2022-11-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \ + \ \"architecture\": \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n\ + \ \"disallowed\": {\r\n \"vmDiskType\": \"None\"\r\n },\r\n \ + \ \"automaticOSUpgradeProperties\": {\r\n \"automaticOSUpgradeSupported\"\ + : true\r\n },\r\n \"imageDeprecationStatus\": {\r\n \"imageState\"\ + : \"Active\"\r\n },\r\n \"features\": [\r\n {\r\n \"name\"\ + : \"IsAcceleratedNetworkSupported\",\r\n \"value\": \"True\"\r\n \ + \ },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n \ + \ \"value\": \"SCSI, NVMe\"\r\n },\r\n {\r\n \"name\":\ + \ \"IsHibernateSupported\",\r\n \"value\": \"True\"\r\n }\r\n\ + \ ],\r\n \"osDiskImage\": {\r\n \"operatingSystem\": \"Linux\"\ + ,\r\n \"sizeInGb\": 31,\r\n \"sizeInBytes\": 32213303808\r\n \ + \ },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"westus\",\r\ + \n \"name\": \"18.04.202301310\",\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/westus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/18.04-LTS/Versions/18.04.202301310\"\ + \r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1048' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12997,Microsoft.Compute/GetVMImageFromLocation30Min;73997 + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {}, "variables": {}, "resources": + [{"name": "vmss000002VNET", "type": "Microsoft.Network/virtualNetworks", "location": + "westus", "apiVersion": "2015-06-15", "dependsOn": [], "tags": {}, "properties": + {"addressSpace": {"addressPrefixes": ["10.0.0.0/16"]}, "subnets": [{"name": + "vmss000002Subnet", "properties": {"addressPrefix": "10.0.0.0/24"}}]}}, {"apiVersion": + "2022-01-01", "type": "Microsoft.Network/publicIPAddresses", "name": "vmss000002LBPublicIP", + "location": "westus", "tags": {}, "dependsOn": [], "properties": {"publicIPAllocationMethod": + "Dynamic"}}, {"type": "Microsoft.Network/loadBalancers", "name": "vmss000002LB", + "location": "westus", "tags": {}, "apiVersion": "2022-01-01", "dependsOn": ["Microsoft.Network/virtualNetworks/vmss000002VNET", + "Microsoft.Network/publicIpAddresses/vmss000002LBPublicIP"], "properties": {"backendAddressPools": + [{"name": "vmss000002LBBEPool"}], "frontendIPConfigurations": [{"name": "loadBalancerFrontEnd", + "properties": {"publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/publicIPAddresses/vmss000002LBPublicIP"}}}], + "inboundNatPools": [{"name": "vmss000002LBNatPool", "properties": {"frontendIPConfiguration": + {"id": "[concat(resourceId(''Microsoft.Network/loadBalancers'', ''vmss000002LB''), + ''/frontendIPConfigurations/'', ''loadBalancerFrontEnd'')]"}, "protocol": "tcp", + "frontendPortRangeStart": "50000", "frontendPortRangeEnd": "50119", "backendPort": + 22}}]}}, {"type": "Microsoft.Compute/virtualMachineScaleSets", "name": "vmss000002", + "location": "westus", "tags": {}, "apiVersion": "2022-11-01", "dependsOn": ["Microsoft.Network/virtualNetworks/vmss000002VNET", + "Microsoft.Network/loadBalancers/vmss000002LB"], "properties": {"overprovision": + false, "upgradePolicy": {"mode": "Manual", "rollingUpgradePolicy": {"maxSurge": + true}}, "singlePlacementGroup": null, "virtualMachineProfile": {"storageProfile": + {"osDisk": {"createOption": "FromImage", "caching": "ReadWrite", "managedDisk": + {"storageAccountType": null}}, "imageReference": {"publisher": "Canonical", + "offer": "UbuntuServer", "sku": "18.04-LTS", "version": "latest"}}, "osProfile": + {"computerNamePrefix": "vmssl42c6", "adminUsername": "v-jingszhang", "linuxConfiguration": + {"disablePasswordAuthentication": true, "ssh": {"publicKeys": [{"path": "/home/v-jingszhang/.ssh/authorized_keys", + "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDtrwjFOJ5BrjyXXI+zTohbjR8C/UT40MJ6M+D7PhvbUDyPYRjOz4B6DnO4xJ5huKhI2jUMIAKiRHcipHqk5ddySS/Z1e91zmHEuEUPeZlOCJJoLxjtAflx6c7aRhPMzOhsEa/7p527/RuMw/vtQZKQP7ltY37oRiAH6OrQJELbYWMGiX37QsGK1oZU0bRohBeiB+C7Ofc7rYjkdxT4AYXNHLOo5Xr7ByL0u7TMwz2fcE7gY5k5Xbw3gmn3oHnCzdJ6Y3m3BAK9uR7tbw97yxwus/aIAi7wm29ljudtQjmSggd21eG0EZfF1greqgaNdq5JGskcRGWbo/VvX9kThjsF"}]}}}, + "networkProfile": {"networkInterfaceConfigurations": [{"name": "vmssl42c6Nic", + "properties": {"ipConfigurations": [{"name": "vmssl42c6IPConfig", "properties": + {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/virtualNetworks/vmss000002VNET/subnets/vmss000002Subnet"}, + "loadBalancerBackendAddressPools": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/loadBalancers/vmss000002LB/backendAddressPools/vmss000002LBBEPool"}], + "loadBalancerInboundNatPools": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/loadBalancers/vmss000002LB/inboundNatPools/vmss000002LBNatPool"}]}}], + "primary": "true"}}]}}, "orchestrationMode": "Uniform"}, "sku": {"name": "Standard_DS1_v2", + "capacity": 2}}], "outputs": {"VMSS": {"type": "object", "value": "[reference(resourceId(''Microsoft.Compute/virtualMachineScaleSets'', + ''vmss000002''),providers(''Microsoft.Compute'', ''virtualMachineScaleSets'').apiVersions[0])]"}}}, + "parameters": {}, "mode": "incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + Content-Length: + - '4181' + Content-Type: + - application/json + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Resources/deployments/vmss_deploy_JqviOby05ZNP6u151B5WL6TJDfOgzi2v","name":"vmss_deploy_JqviOby05ZNP6u151B5WL6TJDfOgzi2v","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7880761898736558886","parameters":{},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-02-01T02:32:19.5870812Z","duration":"PT0.0008416S","correlationId":"8a79c808-6f6c-40f7-8a9a-527b7b9e5786","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]},{"resourceType":"publicIPAddresses","locations":["westus"]},{"resourceType":"loadBalancers","locations":["westus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachineScaleSets","locations":["westus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/virtualNetworks/vmss000002VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vmss000002VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/publicIPAddresses/vmss000002LBPublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmss000002LBPublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/loadBalancers/vmss000002LB","resourceType":"Microsoft.Network/loadBalancers","resourceName":"vmss000002LB"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/virtualNetworks/vmss000002VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vmss000002VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/loadBalancers/vmss000002LB","resourceType":"Microsoft.Network/loadBalancers","resourceName":"vmss000002LB"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss000002","resourceType":"Microsoft.Compute/virtualMachineScaleSets","resourceName":"vmss000002"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Resources/deployments/vmss_deploy_JqviOby05ZNP6u151B5WL6TJDfOgzi2v/operationStatuses/08585263881483758175?api-version=2021-04-01 + cache-control: + - no-cache + content-length: + - '2465' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585263881483758175?api-version=2021-04-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:32:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585263881483758175?api-version=2021-04-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:33:22 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vmss create + Connection: + - keep-alive + ParameterSetName: + - -n -g --image --upgrade-policy-mode --max-surge --disable-overprovision + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.9 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Resources/deployments/vmss_deploy_JqviOby05ZNP6u151B5WL6TJDfOgzi2v","name":"vmss_deploy_JqviOby05ZNP6u151B5WL6TJDfOgzi2v","type":"Microsoft.Resources/deployments","properties":{"templateHash":"7880761898736558886","parameters":{},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-02-01T02:33:17.0792047Z","duration":"PT57.4929651S","correlationId":"8a79c808-6f6c-40f7-8a9a-527b7b9e5786","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["westus"]},{"resourceType":"publicIPAddresses","locations":["westus"]},{"resourceType":"loadBalancers","locations":["westus"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachineScaleSets","locations":["westus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/virtualNetworks/vmss000002VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vmss000002VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/publicIPAddresses/vmss000002LBPublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vmss000002LBPublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/loadBalancers/vmss000002LB","resourceType":"Microsoft.Network/loadBalancers","resourceName":"vmss000002LB"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/virtualNetworks/vmss000002VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vmss000002VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/loadBalancers/vmss000002LB","resourceType":"Microsoft.Network/loadBalancers","resourceName":"vmss000002LB"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss000002","resourceType":"Microsoft.Compute/virtualMachineScaleSets","resourceName":"vmss000002"}],"outputs":{"vmss":{"type":"Object","value":{"singlePlacementGroup":true,"orchestrationMode":"Uniform","upgradePolicy":{"mode":"Manual","rollingUpgradePolicy":{"maxBatchInstancePercent":20,"maxUnhealthyInstancePercent":20,"maxUnhealthyUpgradedInstancePercent":20,"pauseTimeBetweenBatches":"PT0S","maxSurge":true,"rollbackFailedInstancesOnPolicyBreach":false}},"virtualMachineProfile":{"osProfile":{"computerNamePrefix":"vmssl42c6","adminUsername":"v-jingszhang","linuxConfiguration":{"disablePasswordAuthentication":true,"ssh":{"publicKeys":[{"path":"/home/v-jingszhang/.ssh/authorized_keys","keyData":"ssh-rsa + AAAAB3NzaC1yc2EAAAADAQABAAABAQDtrwjFOJ5BrjyXXI+zTohbjR8C/UT40MJ6M+D7PhvbUDyPYRjOz4B6DnO4xJ5huKhI2jUMIAKiRHcipHqk5ddySS/Z1e91zmHEuEUPeZlOCJJoLxjtAflx6c7aRhPMzOhsEa/7p527/RuMw/vtQZKQP7ltY37oRiAH6OrQJELbYWMGiX37QsGK1oZU0bRohBeiB+C7Ofc7rYjkdxT4AYXNHLOo5Xr7ByL0u7TMwz2fcE7gY5k5Xbw3gmn3oHnCzdJ6Y3m3BAK9uR7tbw97yxwus/aIAi7wm29ljudtQjmSggd21eG0EZfF1greqgaNdq5JGskcRGWbo/VvX9kThjsF"}]},"provisionVMAgent":true,"enableVMAgentPlatformUpdates":false},"secrets":[],"allowExtensionOperations":true,"requireGuestProvisionSignal":true},"storageProfile":{"osDisk":{"osType":"Linux","createOption":"FromImage","caching":"ReadWrite","managedDisk":{"storageAccountType":"Premium_LRS"},"diskSizeGB":30},"imageReference":{"publisher":"Canonical","offer":"UbuntuServer","sku":"18.04-LTS","version":"latest"}},"networkProfile":{"networkInterfaceConfigurations":[{"name":"vmssl42c6Nic","properties":{"primary":true,"disableTcpStateTracking":false,"dnsSettings":{"dnsServers":[]},"enableIPForwarding":false,"ipConfigurations":[{"name":"vmssl42c6IPConfig","properties":{"subnet":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/virtualNetworks/vmss000002VNET/subnets/vmss000002Subnet"},"privateIPAddressVersion":"IPv4","loadBalancerBackendAddressPools":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/loadBalancers/vmss000002LB/backendAddressPools/vmss000002LBBEPool"}],"loadBalancerInboundNatPools":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/loadBalancers/vmss000002LB/inboundNatPools/vmss000002LBNatPool"}]}}]}}]}},"provisioningState":"Succeeded","overprovision":false,"doNotRunExtensionsOnOverprovisionedVMs":false,"uniqueId":"bd87191c-190e-4925-a275-bad3a163dcac","timeCreated":"2023-02-01T02:32:37.6018548+00:00"}}},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss000002"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/loadBalancers/vmss000002LB"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/publicIPAddresses/vmss000002LBPublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_with_max_surge000001/providers/Microsoft.Network/virtualNetworks/vmss000002VNET"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '5752' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 01 Feb 2023 02:33:22 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 +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 4a084dda0d7..8dd365f2faa 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 @@ -3476,6 +3476,17 @@ def test_vmss_create_with_policy_setting(self, resource_group): self.check('upgradePolicy.rollingUpgradePolicy.prioritizeUnhealthyInstances', True) ]) + @ResourceGroupPreparer(name_prefix='cli_test_vmss_with_max_surge') + def test_vmss_with_max_surge(self, resource_group): + self.kwargs.update({ + 'vmss': self.create_random_name('vmss', 10) + }) + self.cmd( + 'vmss create -n {vmss} -g {rg} --image ubuntults --upgrade-policy-mode Manual --max-surge true --disable-overprovision', + checks=[ + self.check('vmss.upgradePolicy.rollingUpgradePolicy.maxSurge', True) + ]) + @ResourceGroupPreparer(name_prefix='cli_test_vmss_create_ephemeral_os_disk') def test_vmss_create_ephemeral_os_disk(self, resource_group):