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

fix: scale cannot find VM index for the VMAS+VHD+Linux case #2906

Merged
merged 4 commits into from
Mar 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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