Skip to content
4 changes: 2 additions & 2 deletions src/azure-cli/azure/cli/command_modules/keyvault/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
vm_secrets=$(az vm secret format -s "$secrets")

az vm create -g group-name -n vm-name --admin-username deploy \\
--image debian --secrets "$vm_secrets"
--image Debian11 --secrets "$vm_secrets"
"""

helps['keyvault certificate list'] = """
Expand Down Expand Up @@ -166,7 +166,7 @@
vm_secrets=$(az vm secret format -s "$secrets")

az vm create -g group-name -n vm-name --admin-username deploy \\
--image debian --secrets "$vm_secrets"
--image Debian11 --secrets "$vm_secrets"
"""

helps['keyvault certificate backup'] = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def test_monitor_diagnostic_settings_marketplace_id(self, resource_group):
self.cmd('network nsg create -n {nsg} -g {rg}')

#self.kwargs['mp_id'] = self.cmd('network nsg show -n {nsg} -g {rg}').get_output_in_json()['id']
#self.cmd('vmss create -g {rg} -n {vmss} --image UbuntuLTS --admin-username testadmin --admin-password TestTest12#$')
#self.cmd('vmss create -g {rg} -n {vmss} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-username testadmin --admin-password TestTest12#$')
#self.kwargs['mp_id'] = self.cmd('vmss show -g {rg} -n {vmss}').get_output_in_json()['id']
# self.kwargs['mp_id'] = self.cmd('vm create -g {rg} -n {vm1} --image UbuntuLTS --admin-password TestPassword11!! '
# self.kwargs['mp_id'] = self.cmd('vm create -g {rg} -n {vm1} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-password TestPassword11!! '
# '--admin-username testadmin --authentication-type password').get_output_in_json()['id']

self.cmd('monitor log-analytics workspace create -g {rg} -n {ws}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ def test_monitor_clone_vm_metric_alerts_scenario(self, resource_group):
'rg': resource_group
})

vm1_json = self.cmd('vm create -g {rg} -n {vm1} --image UbuntuLTS --admin-password TestPassword11!! '
vm1_json = self.cmd('vm create -g {rg} -n {vm1} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-password TestPassword11!! '
'--admin-username testadmin --authentication-type password').get_output_in_json()
vm2_json = self.cmd('vm create -g {rg} -n {vm2} --image UbuntuLTS --admin-password TestPassword11!! '
vm2_json = self.cmd('vm create -g {rg} -n {vm2} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-password TestPassword11!! '
'--admin-username testadmin --authentication-type password').get_output_in_json()
vm3_json = self.cmd('vm create -g {rg} -n {vm3} --image UbuntuLTS --admin-password TestPassword11!! '
vm3_json = self.cmd('vm create -g {rg} -n {vm3} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-password TestPassword11!! '
'--admin-username testadmin --authentication-type password').get_output_in_json()
self.kwargs.update({
'vm1_id': vm1_json['id'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_metric_alert_special_char_scenario(self, resource_group):
@ResourceGroupPreparer(name_prefix='cli_test_monitor')
def test_metric_alert_basic_scenarios(self, resource_group):
vm = 'vm1'
vm_json = self.cmd('vm create -g {} -n {} --image UbuntuLTS --admin-password TestPassword11!! --admin-username '
vm_json = self.cmd('vm create -g {} -n {} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-password TestPassword11!! --admin-username '
'testadmin --authentication-type password'.format(resource_group, vm)).get_output_in_json()
vm_id = vm_json['id']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ class NetworkNicConvenienceCommandsScenarioTest(ScenarioTest):
def test_network_nic_convenience_commands(self, resource_group):

self.kwargs['vm'] = 'conveniencevm1'
self.cmd('vm create -g {rg} -n {vm} --image UbuntuLTS --admin-username myusername --admin-password aBcD1234!@#$ --authentication-type password')
self.cmd('vm create -g {rg} -n {vm} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-username myusername --admin-password aBcD1234!@#$ --authentication-type password')
self.kwargs['nic_id'] = self.cmd('vm show -g {rg} -n {vm} --query "networkProfile.networkInterfaces[0].id"').get_output_in_json()
self.cmd('network nic list-effective-nsg --ids {nic_id}',
checks=self.greater_than('length(@)', 0))
Expand Down Expand Up @@ -1335,7 +1335,7 @@ def _network_watcher_configure(self):

def _network_watcher_vm(self):
self.kwargs['private-ip'] = '10.0.0.9'
self.cmd('vm create -g {rg} -n {vm} --image UbuntuLTS --authentication-type password --admin-username deploy --admin-password PassPass10!) --nsg {nsg} --private-ip-address {private-ip}')
self.cmd('vm create -g {rg} -n {vm} --image Canonical:UbuntuServer:18.04-LTS:latest --authentication-type password --admin-username deploy --admin-password PassPass10!) --nsg {nsg} --private-ip-address {private-ip}')
self.cmd('vm extension set -g {rg} --vm-name {vm} -n NetworkWatcherAgentLinux --publisher Microsoft.Azure.NetworkWatcher')

self.cmd('network watcher show-topology -g {rg}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ class NetworkNicConvenienceCommandsScenarioTest(ScenarioTest):
def test_network_nic_convenience_commands(self, resource_group):

self.kwargs['vm'] = 'conveniencevm1'
self.cmd('vm create -g {rg} -n {vm} --image UbuntuLTS --admin-username myusername --admin-password aBcD1234!@#$ --authentication-type password')
self.cmd('vm create -g {rg} -n {vm} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-username myusername --admin-password aBcD1234!@#$ --authentication-type password')
self.kwargs['nic_id'] = self.cmd('vm show -g {rg} -n {vm} --query "networkProfile.networkInterfaces[0].id"').get_output_in_json()
self.cmd('network nic list-effective-nsg --ids {nic_id}',
checks=self.greater_than('length(@)', 0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ class NetworkNicConvenienceCommandsScenarioTest(ScenarioTest):
def test_network_nic_convenience_commands(self, resource_group):

self.kwargs['vm'] = 'conveniencevm1'
self.cmd('vm create -g {rg} -n {vm} --image UbuntuLTS --admin-username myusername --admin-password aBcD1234!@#$ --authentication-type password')
self.cmd('vm create -g {rg} -n {vm} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-username myusername --admin-password aBcD1234!@#$ --authentication-type password')
self.kwargs['nic_id'] = self.cmd('vm show -g {rg} -n {vm} --query "networkProfile.networkInterfaces[0].id"').get_output_in_json()
self.cmd('network nic list-effective-nsg --ids {nic_id}',
checks=self.greater_than('length(@)', 0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4526,7 +4526,7 @@ class NetworkNicConvenienceCommandsScenarioTest(ScenarioTest):
def test_network_nic_convenience_commands(self, resource_group):

self.kwargs['vm'] = 'conveniencevm1'
self.cmd('vm create -g {rg} -n {vm} --image UbuntuLTS --admin-username myusername --admin-password aBcD1234!@#$ --authentication-type password --nsg-rule None')
self.cmd('vm create -g {rg} -n {vm} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-username myusername --admin-password aBcD1234!@#$ --authentication-type password --nsg-rule None')
self.kwargs['nic_id'] = self.cmd('vm show -g {rg} -n {vm} --query "networkProfile.networkInterfaces[0].id"').get_output_in_json()
self.cmd('network nic list-effective-nsg --ids {nic_id}',
checks=self.greater_than('length(@)', 0))
Expand Down Expand Up @@ -6132,7 +6132,7 @@ def test_network_watcher_vm(self, resource_group, resource_group_location):
'private-ip': '10.0.0.9'
})

vm = self.cmd('vm create -g {rg} -n {vm} --image UbuntuLTS --authentication-type password --admin-username deploy --admin-password PassPass10!) --nsg {nsg} --nsg-rule None --private-ip-address {private-ip}').get_output_in_json()
vm = self.cmd('vm create -g {rg} -n {vm} --image Canonical:UbuntuServer:18.04-LTS:latest --authentication-type password --admin-username deploy --admin-password PassPass10!) --nsg {nsg} --nsg-rule None --private-ip-address {private-ip}').get_output_in_json()
self.kwargs['vm_id'] = vm['id']
self.cmd('vm extension set -g {rg} --vm-name {vm} -n NetworkWatcherAgentLinux --publisher Microsoft.Azure.NetworkWatcher')

Expand All @@ -6156,7 +6156,7 @@ def test_network_watcher_packet_capture(self, resource_group, resource_group_loc
'capture2': 'capture2'
})

self.cmd('vm create -g {rg} -n {vm} --image UbuntuLTS --authentication-type password --admin-username deploy --admin-password PassPass10!) --nsg {vm} --nsg-rule None')
self.cmd('vm create -g {rg} -n {vm} --image Canonical:UbuntuServer:18.04-LTS:latest --authentication-type password --admin-username deploy --admin-password PassPass10!) --nsg {vm} --nsg-rule None')
self.cmd('vm extension set -g {rg} --vm-name {vm} -n NetworkWatcherAgentLinux --publisher Microsoft.Azure.NetworkWatcher')

self.cmd('network watcher packet-capture create -g {rg} --vm {vm} -n {capture1} --file-path capture/capture.cap')
Expand All @@ -6181,7 +6181,7 @@ def test_network_watcher_packet_capture_vmss_as_target(self, resource_group, res
'capture1': 'captureVMSS1',
'capture2': 'captureVMSS2'
})
self.cmd('vmss create -g {rg} --name {vmss} --image UbuntuLTS --location {loc} --admin-username azureuser --generate-ssh-keys --upgrade-policy-mode Automatic')
self.cmd('vmss create -g {rg} --name {vmss} --image Canonical:UbuntuServer:18.04-LTS:latest --location {loc} --admin-username azureuser --generate-ssh-keys --upgrade-policy-mode Automatic')
self.cmd('vmss extension set --name NetworkWatcherAgentLinux --publisher Microsoft.Azure.NetworkWatcher --resource-group {rg} --vmss-name {vmss}')

self.cmd('network watcher packet-capture create -g {rg} --target {vmss} -n {capture} --target-type AzureVMSS --file-path capture/capture.cap', checks=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class NWConnectionMonitorScenarioTest(ScenarioTest):

def _prepare_vm(self, resource_group, vm):
vm_create_cmd_tpl = 'vm create -g {rg} --name {vm} ' \
'--image UbuntuLTS ' \
'--image Canonical:UbuntuServer:18.04-LTS:latest ' \
'--nsg {vm} ' \
'--generate-ssh-keys '\
'--nsg-rule None '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def test_invoke_action(self, resource_group):
'pass': self.create_random_name('Longpassword#1', 30)
})

self.kwargs['vm_id'] = self.cmd('vm create -g {rg} -n {vm} --use-unmanaged-disk --image UbuntuLTS --admin-username {user} --admin-password {pass} --authentication-type password --nsg-rule None').get_output_in_json()['id']
self.kwargs['vm_id'] = self.cmd('vm create -g {rg} -n {vm} --use-unmanaged-disk --image Canonical:UbuntuServer:18.04-LTS:latest --admin-username {user} --admin-password {pass} --authentication-type password --nsg-rule None').get_output_in_json()['id']

self.cmd('resource invoke-action --action powerOff --ids {vm_id}')
self.cmd('resource invoke-action --action generalize --ids {vm_id}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_delete_dependent_resources(self, resource_group):
username = 'ubuntu'
password = self.create_random_name('Password#1', 30)

self.cmd('vm create -n {} -g {} --image UbuntuLTS --tag {} '
self.cmd('vm create -n {} -g {} --image Canonical:UbuntuServer:18.04-LTS:latest --tag {} '
'--admin-username {} --admin-password {} --authentication-type {} --nsg-rule None'
.format(vm_name, resource_group, tag_name, username, password, 'password'))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ def test_invoke_action(self, resource_group):
'pass': self.create_random_name('Longpassword#1', 30)
})

self.kwargs['vm_id'] = self.cmd('vm create -g {rg} -n {vm} --use-unmanaged-disk --image UbuntuLTS --admin-username {user} --admin-password {pass} --authentication-type password --nsg-rule None').get_output_in_json()['id']
self.kwargs['vm_id'] = self.cmd('vm create -g {rg} -n {vm} --use-unmanaged-disk --image Canonical:UbuntuServer:18.04-LTS:latest --admin-username {user} --admin-password {pass} --authentication-type password --nsg-rule None').get_output_in_json()['id']

self.cmd('resource invoke-action --action powerOff --ids {vm_id}')
self.cmd('resource invoke-action --action generalize --ids {vm_id}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_delete_dependent_resources(self, resource_group):
username = 'ubuntu'
password = self.create_random_name('Password#1', 30)

self.cmd('vm create -n {} -g {} --image UbuntuLTS --tag {} '
self.cmd('vm create -n {} -g {} --image Canonical:UbuntuServer:18.04-LTS:latest --tag {} '
'--admin-username {} --admin-password {} --authentication-type {} --nsg-rule None'
.format(vm_name, resource_group, tag_name, username, password, 'password'))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def test_resource_patch(self, resource_group):
'vm': 'vm'
})
self.kwargs['vm_id'] = self.cmd(
'vm create -g {rg} -n {vm} --image UbuntuLTS --size Standard_D2s_v3 --v-cpus-available 1 '
'vm create -g {rg} -n {vm} --image Canonical:UbuntuServer:18.04-LTS:latest --size Standard_D2s_v3 --v-cpus-available 1 '
'--v-cpus-per-core 1 --admin-username vmtest --generate-ssh-keys --nsg-rule NONE',
).get_output_in_json()['id']

Expand Down Expand Up @@ -4735,7 +4735,7 @@ def test_group_deployment_cross_tenant(self, resource_group, another_resource_gr
self.cmd('sig image-definition show -g {rg} --gallery-name {gallery} --gallery-image-definition {image} --subscription {aux_sub}',
checks=self.check('name', self.kwargs['image']))

self.cmd('vm create -g {rg} -n {vm} --image ubuntults --admin-username clitest1 --generate-ssh-key --subscription {aux_sub}')
self.cmd('vm create -g {rg} -n {vm} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-username clitest1 --generate-ssh-key --subscription {aux_sub}')
self.cmd(
'vm run-command invoke -g {rg} -n {vm} --command-id RunShellScript --scripts "echo \'sudo waagent -deprovision+user --force\' | at -M now + 1 minutes" --subscription {aux_sub}')
time.sleep(70)
Expand Down Expand Up @@ -4859,7 +4859,7 @@ def test_deployment_group_cross_tenant(self, resource_group, another_resource_gr
self.cmd('sig image-definition show -g {rg} --gallery-name {gallery} --gallery-image-definition {image} --subscription {aux_sub}',
checks=self.check('name', self.kwargs['image']))

self.cmd('vm create -g {rg} -n {vm} --image ubuntults --admin-username clitest1 --generate-ssh-key --subscription {aux_sub}')
self.cmd('vm create -g {rg} -n {vm} --image Canonical:UbuntuServer:18.04-LTS:latest --admin-username clitest1 --generate-ssh-key --subscription {aux_sub}')
self.cmd(
'vm run-command invoke -g {rg} -n {vm} --command-id RunShellScript --scripts "echo \'sudo waagent -deprovision+user --force\' | at -M now + 1 minutes" --subscription {aux_sub}')
time.sleep(70)
Expand Down Expand Up @@ -4954,7 +4954,7 @@ def test_invoke_action(self, resource_group):
'pass': self.create_random_name('Longpassword#1', 30)
})

self.kwargs['vm_id'] = self.cmd('vm create -g {rg} -n {vm} --use-unmanaged-disk --image UbuntuLTS --admin-username {user} --admin-password {pass} --authentication-type password --nsg-rule None').get_output_in_json()['id']
self.kwargs['vm_id'] = self.cmd('vm create -g {rg} -n {vm} --use-unmanaged-disk --image Canonical:UbuntuServer:18.04-LTS:latest --admin-username {user} --admin-password {pass} --authentication-type password --nsg-rule None').get_output_in_json()['id']

self.cmd('resource invoke-action --action powerOff --ids {vm_id} --no-wait')
time.sleep(20)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_delete_dependent_resources(self, resource_group):
username = 'ubuntu'
password = self.create_random_name('Password#1', 30)

self.cmd('vm create -n {} -g {} --image UbuntuLTS --tag {} '
self.cmd('vm create -n {} -g {} --image Canonical:UbuntuServer:18.04-LTS:latest --tag {} '
'--admin-username {} --admin-password {} --authentication-type {} --nsg-rule None'
.format(vm_name, resource_group, tag_name, username, password, 'password'))

Expand Down
61 changes: 6 additions & 55 deletions src/azure-cli/azure/cli/command_modules/vm/_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,25 @@
"type": "object",
"value": {
"Linux": {
"CentOS": {
"publisher": "OpenLogic",
"offer": "CentOS",
"sku": "7.5",
"version": "latest",
"architecture": "x64"
},
"CentOS85Gen2": {
"publisher": "OpenLogic",
"offer": "CentOS",
"sku": "8_5-gen2",
"version": "latest",
"architecture": "x64"
},
"Debian": {
"publisher": "Debian",
"offer": "debian-10",
"sku": "10",
"version": "latest",
"architecture": "x64"
},
"Debian11": {
"publisher": "Debian",
"offer": "debian-11",
"sku": "11-backports-gen2",
"version": "latest",
"architecture": "x64"
},
"Flatcar": {
"publisher": "kinvolk",
"offer": "flatcar-container-linux-free",
"sku": "stable",
"version": "latest",
"offer": "debian-11",
"sku": "11-backports-gen2",
"version": "latest",
"architecture": "x64"
},
"FlatcarLinuxFreeGen2": {
"publisher": "kinvolk",
"offer": "flatcar-container-linux-free",
"sku": "stable-gen2",
"version": "latest",
"architecture": "x64"
},
"openSUSE-Leap": {
"publisher": "SUSE",
"offer": "opensuse-leap-15-3",
"sku": "gen2",
"version": "latest",
"offer": "flatcar-container-linux-free",
"sku": "stable-gen2",
"version": "latest",
"architecture": "x64"
},
"OpenSuseLeap154Gen2": {
Expand All @@ -74,41 +46,20 @@
"version": "latest",
"architecture": "x64"
},
"RHEL": {
"publisher": "RedHat",
"offer": "RHEL",
"sku": "7-LVM",
"version": "latest",
"architecture": "x64"
},
"RHELRaw8LVMGen2": {
"publisher": "RedHat",
"offer": "RHEL",
"sku": "8-lvm-gen2",
"version": "latest",
"architecture": "x64"
},
"SLES": {
"publisher": "SUSE",
"offer": "sles-15-sp3",
"sku": "gen2",
"version": "latest",
"architecture": "x64"
},
"SuseSles15SP3": {
"publisher": "SUSE",
"offer": "sles-15-sp3",
"sku": "gen2",
"version": "latest",
"architecture": "x64"
},
"UbuntuLTS": {
"publisher": "Canonical",
"offer": "UbuntuServer",
"sku": "18.04-LTS",
"version": "latest",
"architecture": "x64"
},
"Ubuntu2204": {
"publisher": "Canonical",
"offer": "0001-com-ubuntu-server-jammy",
Expand Down
Loading