Azure / Azure/azure-cli

az vm {create,update} should block non-ASCII hostnames for Linux VMs

Open
#24,821 1 comment 0 reactions 2 assignees Assigned to @zhoxing-ms View on GitHub
act-observability-squad act-platform-engineering-squad Auto-Assign Azure CLI Team Compute feature-request Installation
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

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.