-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Compute] Fix #20174: az vm create: Determine plan information when using image alias
#21028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -498,15 +498,18 @@ def _build_storage_profile(): | |
|
|
||
| return profile | ||
|
|
||
| vm_properties = {'hardwareProfile': {'vmSize': size}, 'networkProfile': {'networkInterfaces': nics}, | ||
| 'storageProfile': _build_storage_profile()} | ||
|
|
||
| vm_size_properties = {} | ||
| if v_cpus_available is not None: | ||
| vm_size_properties['vCPUsAvailable'] = v_cpus_available | ||
|
|
||
| if v_cpus_per_core is not None: | ||
| vm_size_properties['vCPUsPerCore'] = v_cpus_per_core | ||
|
|
||
| vm_properties = {'hardwareProfile': {'vmSize': size, 'vmSizeProperties': vm_size_properties}, | ||
| 'networkProfile': {'networkInterfaces': nics}, 'storageProfile': _build_storage_profile()} | ||
| if vm_size_properties: | ||
| vm_properties['hardwareProfile']['vmSizeProperties'] = vm_size_properties | ||
|
|
||
| if availability_set_id: | ||
| vm_properties['availabilitySet'] = {'id': availability_set_id} | ||
|
|
@@ -529,12 +532,13 @@ def _build_storage_profile(): | |
| } | ||
| } | ||
|
|
||
| vm_properties['additionalCapabilities'] = {} | ||
| if ultra_ssd_enabled is not None: | ||
| vm_properties['additionalCapabilities']['ultraSSDEnabled'] = ultra_ssd_enabled | ||
| if cmd.supported_api_version(min_api='2018-06-01'): | ||
| vm_properties['additionalCapabilities'] = {} | ||
| if ultra_ssd_enabled is not None: | ||
| vm_properties['additionalCapabilities']['ultraSSDEnabled'] = ultra_ssd_enabled | ||
|
|
||
| if enable_hibernation is not None: | ||
| vm_properties['additionalCapabilities']['hibernationEnabled'] = enable_hibernation | ||
| if enable_hibernation is not None: | ||
| vm_properties['additionalCapabilities']['hibernationEnabled'] = enable_hibernation | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| if proximity_placement_group: | ||
| vm_properties['proximityPlacementGroup'] = {'id': proximity_placement_group} | ||
|
|
||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -768,7 +768,7 @@ def test_vm_extension(self, resource_group): | |
| self.cmd('vm extension set -n {ext} --publisher {pub} --version 1.2 --vm-name {vm} --resource-group {rg} --protected-settings "{config}" --force-update') | ||
| self.cmd('vm get-instance-view -n {vm} -g {rg}', checks=[ | ||
| self.check('*.extensions[0].name', ['VMAccessForLinux']), | ||
| self.check('*.extensions[0].typeHandlerVersion', ['1.4.7.1']) | ||
| self.check('*.extensions[0].typeHandlerVersion', ['1.5.11']) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ]) | ||
| result = self.cmd('vm extension show --resource-group {rg} --vm-name {vm} --name {ext}', checks=[ | ||
| self.check('type(@)', 'object'), | ||
|
|
@@ -928,6 +928,7 @@ def test_vm_create_none_options(self, resource_group): | |
|
|
||
| class VMBootDiagnostics(ScenarioTest): | ||
|
|
||
| @AllowLargeResponse() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| @ResourceGroupPreparer(name_prefix='cli_test_vm_diagnostics') | ||
| @StorageAccountPreparer(name_prefix='clitestbootdiag') | ||
| def test_vm_boot_diagnostics(self, resource_group, storage_account): | ||
|
|
@@ -1148,7 +1149,7 @@ def test_vm_create_custom_ip(self, resource_group): | |
| 'public_ip_sku': 'Standard' | ||
| }) | ||
|
|
||
| self.cmd('vm create -n {vm} -g {rg} --image openSUSE-Leap --admin-username user11 --private-ip-address 10.0.0.5 --public-ip-sku {public_ip_sku} --public-ip-address-dns-name {dns} --generate-ssh-keys') | ||
| self.cmd('vm create -n {vm} -g {rg} --image UbuntuLTS --admin-username user11 --private-ip-address 10.0.0.5 --public-ip-sku {public_ip_sku} --public-ip-address-dns-name {dns} --generate-ssh-keys') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| self.cmd('network public-ip show -n {vm}PublicIP -g {rg}', checks=[ | ||
| self.check('publicIpAllocationMethod', 'Static'), | ||
|
|
@@ -1159,7 +1160,7 @@ def test_vm_create_custom_ip(self, resource_group): | |
| checks=self.check('ipConfigurations[0].privateIpAllocationMethod', 'Static')) | ||
|
|
||
| # verify the default should be "Basic" sku with "Dynamic" allocation method | ||
| self.cmd('vm create -n {vm2} -g {rg} --image openSUSE-Leap --admin-username user11 --generate-ssh-keys') | ||
| self.cmd('vm create -n {vm2} -g {rg} --image UbuntuLTS --admin-username user11 --generate-ssh-keys') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
| self.cmd('network public-ip show -n {vm2}PublicIP -g {rg}', checks=[ | ||
| self.check('publicIpAllocationMethod', 'Dynamic'), | ||
| self.check('sku.name', 'Basic') | ||
|
|
@@ -1283,6 +1284,7 @@ def test_vm_create_custom_data(self, resource_group): | |
|
|
||
| class VMSSCreateAndModify(ScenarioTest): | ||
|
|
||
| @AllowLargeResponse() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
| @ResourceGroupPreparer(name_prefix='cli_test_vmss_create_and_modify') | ||
| def test_vmss_create_and_modify(self): | ||
|
|
||
|
|
@@ -1497,7 +1499,7 @@ def test_vmss_accelerated_networking(self, resource_group): | |
| self.kwargs.update({ | ||
| 'vmss': 'vmss1' | ||
| }) | ||
| self.cmd("vmss create -n {vmss} -g {rg} --vm-sku Standard_DS4_v2 --image Win2022Datacenter --admin-username clittester --admin-password Test12345678!!! --accelerated-networking --instance-count 1") | ||
| self.cmd("vmss create -n {vmss} -g {rg} --vm-sku Standard_DS4_v2 --image Win2012R2Datacenter --admin-username clittester --admin-password Test12345678!!! --accelerated-networking --instance-count 1") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using image |
||
| self.cmd('vmss show -n {vmss} -g {rg}', | ||
| checks=self.check('virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].enableAcceleratedNetworking', True)) | ||
|
|
||
|
|
||





There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
{ "status": "Failed", "error": { "code": "DeploymentFailed", "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.", "details": [ { "code": "BadRequest", "message": { "error": { "details": [ { "message": "Could not find member vmSizeProperties on object of type VMHardwareProfile. Path properties.hardwareProfile.vmSizeProperties, line 1, position 110.", "target": "vm.properties.hardwareProfile.vmSizeProperties" }, { "message": "Could not find member additionalCapabilities on object of type Properties. Path properties.additionalCapabilities, line 1, position 1230.", "target": "vm.properties.additionalCapabilities" } ], "code": "BadRequest", "message": "The request message is invalid." } } } ] } }