Skip to content

Commit e66a980

Browse files
committed
vmss deallocate migration
1 parent 228acd2 commit e66a980

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5587,17 +5587,49 @@ def _check_vms_power_state(self, *args):
55875587
self.assertTrue(result['statuses'][1]['code'] in args)
55885588

55895589
@ResourceGroupPreparer(name_prefix='cli_test_vmss_vms')
5590+
@AllowLargeResponse(size_kb=99999)
55905591
def test_vmss_vms(self, resource_group):
55915592

55925593
self.kwargs.update({
55935594
'vmss': self.create_random_name('clitestvmss', 20),
55945595
'flex_vmss': self.create_random_name('clitestflexvms', 20),
55955596
'count': 2,
5596-
'instance_ids': []
5597+
'instance_ids': [],
5598+
'nsg': 'nsg1',
5599+
'pubip1': 'pubip1',
5600+
55975601
})
5602+
5603+
self.cmd('network nsg create -g {rg} -n {nsg}')
5604+
# Create a public IP resource with service tag
5605+
5606+
# self.cmd("feature register --namespace Microsoft.Network --name AllowBringYourOwnPublicIpAddress")
5607+
# self.cmd("provider register -n Microsoft.Network")
5608+
5609+
self.cmd('network public-ip create --name {pubip1} -g {rg} --ip-tags FirstPartyUsage=/NonProd')
5610+
5611+
self.cmd('vmss create -g {rg} -n {vmss} --image Canonical:ubuntu-24_04-lts:server:latest --authentication-type password --lb-sku Standard '
5612+
'--admin-username admin123 --admin-password TestTest12#$ --instance-count {count} --orchestration-mode Uniform --public-ip-address {pubip1} --nsg {nsg}')
5613+
5614+
5615+
5616+
5617+
# # Create NSG
5618+
# self.cmd('network nsg create -g {rg} -n {nsg}')
5619+
5620+
# # Add rule to deny high-risk ports (SSH and RDP)
5621+
# self.cmd('network nsg rule create -g {rg} --nsg-name {nsg} -n DenyHighRiskPorts --priority 101 '
5622+
# '--access Deny --protocol Tcp --direction Inbound --source-address-prefix Internet '
5623+
# '--source-port-range "*" --destination-address-prefix "*" --destination-port-ranges 22 3389')
5624+
5625+
# # Create VMSS with the NSG attached
5626+
# self.cmd('vmss create -g {rg} -n {vmss} --image Canonical:ubuntu-24_04-lts:server:latest '
5627+
# '--authentication-type password --lb-sku Standard '
5628+
# '--admin-username admin123 --admin-password TestTest12#$ '
5629+
# '--instance-count {count} --orchestration-mode Uniform --nsg {nsg}')
5630+
5631+
55985632

5599-
self.cmd('vmss create -g {rg} -n {vmss} --image Canonical:UbuntuServer:18.04-LTS:latest --authentication-type password --lb-sku Standard '
5600-
'--admin-username admin123 --admin-password TestTest12#$ --instance-count {count} --orchestration-mode Uniform')
56015633

56025634
instance_list = self.cmd('vmss list-instances --resource-group {rg} --name {vmss}', checks=[
56035635
self.check('type(@)', 'array'),

0 commit comments

Comments
 (0)