@@ -1033,6 +1033,10 @@ def aks_create(
10331033 # apiserver vnet integration
10341034 enable_apiserver_vnet_integration = False ,
10351035 apiserver_subnet_id = None ,
1036+ # BYO VNet for Managed System Pool (Automatic SKU)
1037+ system_node_subnet_id = None ,
1038+ node_subnet_id = None ,
1039+ enable_hosted_system = False ,
10361040 # node provisioning
10371041 node_provisioning_mode = None ,
10381042 node_provisioning_default_pools = None ,
@@ -1276,7 +1280,7 @@ def aks_upgrade(cmd,
12761280 instance = client .get (resource_group_name , name )
12771281
12781282 vmas_cluster = False
1279- for agent_profile in instance .agent_pool_profiles :
1283+ for agent_profile in ( instance .agent_pool_profiles or []) :
12801284 if agent_profile .type .lower () == "availabilityset" :
12811285 vmas_cluster = True
12821286 break
@@ -1293,7 +1297,7 @@ def aks_upgrade(cmd,
12931297
12941298 # This only provide convenience for customer at client side so they can run az aks upgrade to upgrade all
12951299 # nodepools of a cluster. The SDK only support upgrade single nodepool at a time.
1296- for agent_pool_profile in instance .agent_pool_profiles :
1300+ for agent_pool_profile in ( instance .agent_pool_profiles or []) :
12971301 if vmas_cluster :
12981302 raise CLIError ('This cluster is using AvailabilitySet. Node image upgrade only operation '
12991303 'can only be applied on VirtualMachineScaleSets or VirtualMachines cluster.' )
@@ -1357,7 +1361,7 @@ def aks_upgrade(cmd,
13571361 return None
13581362
13591363 if upgrade_all :
1360- for agent_profile in instance .agent_pool_profiles :
1364+ for agent_profile in ( instance .agent_pool_profiles or []) :
13611365 agent_profile .orchestrator_version = kubernetes_version
13621366 agent_profile .creation_data = None
13631367
@@ -1441,12 +1445,17 @@ def _upgrade_single_nodepool_image_version(no_wait, client, resource_group_name,
14411445def aks_scale (cmd , client , resource_group_name , name , node_count , nodepool_name = "" , no_wait = False ):
14421446 instance = client .get (resource_group_name , name )
14431447
1444- if len (instance .agent_pool_profiles ) > 1 and nodepool_name == "" :
1448+ agent_pool_profiles = instance .agent_pool_profiles or []
1449+ if not agent_pool_profiles :
1450+ raise CLIError ('The cluster has no scalable node pools (this may be a Managed System Pool for '
1451+ 'Automatic cluster). Use az aks nodepool add/scale against a user node pool instead.' )
1452+
1453+ if len (agent_pool_profiles ) > 1 and nodepool_name == "" :
14451454 raise CLIError ('There are more than one node pool in the cluster. '
14461455 'Please specify nodepool name or use az aks nodepool command to scale node pool' )
14471456
1448- for agent_profile in instance . agent_pool_profiles :
1449- if agent_profile .name == nodepool_name or (nodepool_name == "" and len (instance . agent_pool_profiles ) == 1 ):
1457+ for agent_profile in agent_pool_profiles :
1458+ if agent_profile .name == nodepool_name or (nodepool_name == "" and len (agent_pool_profiles ) == 1 ):
14501459 if agent_profile .enable_auto_scaling :
14511460 raise CLIError (
14521461 "Cannot scale cluster autoscaler enabled node pool." )
0 commit comments