Azure / Azure/azure-cli

Cannot create a flexible scale set with a Windows Server Core image

Open
#21,504 6 comments 2 reactions 2 assignees Assigned to @zhoxing-ms View on GitHub
act-observability-squad Auto-Assign Compute customer-reported
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

## Describe the bug

It seems to be impossible to create a VMSS using flexible orchestration mode and a Windows Server Core image (e.g. `MicrosoftWindowsServer:WindowsServer:2022-datacenter-azure-edition-core-smalldisk:latest`). It seems that the image enables hotpatching by default and there is no way to get hotpatching to work with flexible scale sets.

**Command Name**
`az vmss create`

**Errors:**
```
{"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"BadRequest","message":"{\r\n \"error\": {\r\n \"code\": \"InvalidParameter\",\r\n \"message\": \"EnableHotpatching cannot be set to true. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to 'AutomaticByPlatform'.\",\r\n \"target\": \"windowsConfiguration.patchSettings.enableHotpatching\"\r\n }\r\n}"}]}}

```

## To Reproduce:

Run the following command (some common parameters have been left off for brevity):

```shell
az vmss create \
--orchestration-mode Flexible \
--image MicrosoftWindowsServer:WindowsServer:2022-datacenter-azure-edition-core-smalldisk:latest \
--vm-sku Standard_B1ms
```

After receiving an error, I tried manually setting `--patch-mode`. Unfortunately `--patch-mode AutomaticByPlatform` is documented as not working, so I tried using `--patch-mode Manual`, which didn't solve the original issue and gave a more cryptic error message: `'windowsConfiguration'`

I was able to solve the `'windowsConfiguration'` error by adding a few more parameters:

```shell
az vmss create \
--orchestration-mode Flexible \
--image MicrosoftWindowsServer:WindowsServer:2022-datacenter-azure-edition-core-smalldisk:latest \
--vm-sku Standard_B1ms \
--patch-mode Manual \
--enable-auto-update false \
--enable-agent true
```

The original error persisted though.

## Expected Behavior

- Ideally I would be able to use a Windows Server Core image interchangeably with other Windows Server images without having to adjust any other parameters in my `az vmss create` command.
- `az vmss create` should support `--patch-mode AutomaticByPlatform`
- `az vmss create` should support `--enable-hotpatching false`

## Environment Summary
```
macOS-12.2.1-x86_64-i386-64bit, Darwin 21.3.0
Python 3.10.2
Installer: HOMEBREW

azure-cli 2.34.0
```
## Additional Context

I was able to get the above commands to work when I switched the VM SKU to `Standard_DS1_v2`, but the resulting scale set was broken. It could not create new VMs so scaling up would always silently fail (I assume for the same reason as above). Ideally using different VM SKUs would fail in a consistent manner.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.