Skip to content

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

@jasonzio

Description

@jasonzio

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):


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

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions