az vm {create,update} should block non-ASCII hostnames for Linux VMs
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62
**Related command**
**Describe the bug**
Linux does not permit non-ASCII characters in hostnames, but neither `az vm create` nor `az vm update` blocks them. This will result in failure to create the VM (create) via OS Provisioning Timeout (OSPTO) and can cause a VM to become unbootable (update).
The Azure portal already blocks attempts to use non-ASCII hostnames for Linux VMs.
From the Linux documentation for [hostname(7) - Linux manual page (man7.org)](https://www.man7.org/linux/man-pages/man7/hostname.7.html):
```text
Each element of the hostname must be from 1 to 63 characters long
and the entire hostname, including the dots, can be at most 253
characters long. Valid characters for hostnames are ASCII
letters from a to z, the digits from 0 to 9, and the hyphen (-).
A hostname may not start with a hyphen.
```
**To Reproduce**
az vm create --name 'mapxu-test-name-乱写一些单词' using a Linux VM image.
**Expected behavior**
An error message should be issued.
**Environment summary**
Linux VM
**Additional context**
Contributor guide
Assessment
This issue has not been assessed yet.