Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fix: scale cannot find VM index for the VMAS+VHD+Linux case (#2906)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadarsie authored Mar 18, 2020
1 parent 5b51d35 commit 1ae9cca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
3 changes: 1 addition & 2 deletions cmd/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ func (sc *scaleCmd) run(cmd *cobra.Command, args []string) error {
continue
}

osPublisher := vm.StorageProfile.ImageReference.Publisher
if osPublisher != nil && (strings.EqualFold(*osPublisher, "MicrosoftWindowsServer") || strings.EqualFold(*osPublisher, "microsoft-aks")) {
if sc.agentPool.OSType == api.Windows {
_, _, winPoolIndex, index, err = utils.WindowsVMNameParts(vmName)
} else {
_, _, index, err = utils.K8sLinuxVMNameParts(vmName)
Expand Down
20 changes: 19 additions & 1 deletion test/e2e/test_cluster_configs/availabilityset.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"env": {
"CREATE_VNET": true
"CREATE_VNET": true,
"SCALE_CLUSTER": true
},
"apiModel": {
"apiVersion": "vlabs",
Expand Down Expand Up @@ -43,6 +44,7 @@
"name": "agent1",
"count": 3,
"vmSize": "Standard_D2_v3",
"osType": "Linux",
"OSDiskSizeGB": 200,
"storageProfile": "ManagedDisks",
"diskSizesGB": [
Expand All @@ -51,6 +53,16 @@
],
"availabilityProfile": "AvailabilitySet",
"vnetSubnetId": "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/virtualNetworks/VNET_NAME/subnets/SUBNET_NAME"
},
{
"name": "poolwin",
"count": 2,
"vmSize": "Standard_D2_v3",
"osType": "Windows",
"OSDiskSizeGB": 200,
"storageProfile": "ManagedDisks",
"availabilityProfile": "AvailabilitySet",
"vnetSubnetId": "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/virtualNetworks/VNET_NAME/subnets/SUBNET_NAME"
}
],
"linuxProfile": {
Expand All @@ -63,6 +75,12 @@
]
}
},
"windowsProfile": {
"adminUsername": "azureuser",
"adminPassword": "replacepassword1234$",
"enableAutomaticUpdates": false,
"sshEnabled": true
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
Expand Down

0 comments on commit 1ae9cca

Please sign in to comment.