有关 Linux 虚拟机的常见问题Frequently asked question about Linux Virtual Machines

本文讨论有关在 Azure 中使用 Resource Manager 部署模型创建的 Linux 虚拟机的一些常见问题。This article addresses some common questions about Linux virtual machines created in Azure using the Resource Manager deployment model. 有关本主题的 Windows 版本,请参阅有关 Windows 虚拟机的常见问题For the Windows version of this topic, see Frequently asked question about Windows Virtual Machines

我可以在 Azure VM 上运行什么程序?What can I run on an Azure VM?

所有订户都可以在 Azure 虚拟机上运行服务器软件。All subscribers can run server software on an Azure virtual machine. 有关详细信息,请参阅 Azure 认可的分发版本中的 LinuxFor more information, see Linux on Azure-Endorsed Distributions

使用虚拟机时,我可以使用多少存储?How much storage can I use with a virtual machine?

每个数据磁盘的容量高达 32,767 GiB。Each data disk can be up to 32,767 GiB. 可以使用的数据磁盘数取决于虚拟机大小。The number of data disks you can use depends on the size of the virtual machine. 有关详细信息,请参阅虚拟机大小For details, see Sizes for Virtual Machines.

Azure 托管磁盘是推荐用于 Azure 虚拟机的磁盘存储产品,方便永久存储数据。Azure Managed Disks are the recommended disk storage offerings for use with Azure Virtual Machines for persistent storage of data. 可对每个虚拟机使用多个托管磁盘。You can use multiple Managed Disks with each Virtual Machine. 托管磁盘提供两种类型的持久存储选项:高级和标准托管磁盘。Managed Disks offer two types of durable storage options: Premium and Standard Managed Disks. 有关定价信息,请参阅托管磁盘定价For pricing information, see Managed Disks Pricing.

Azure 存储帐户还可为操作系统磁盘和任何数据磁盘提供存储空间。Azure storage accounts can also provide storage for the operating system disk and any data disks. 每个磁盘都是一个 .vhd 文件,以页 blob 形式存储。Each disk is a .vhd file stored as a page blob. 有关定价详细信息,请参阅 Storage Pricing Details(存储定价详细信息)。For pricing details, see Storage Pricing Details.

如何访问我的虚拟机?How can I access my virtual machine?

使用安全外壳 (SSH) 建立远程连接,以登录到虚拟机。Establish a remote connection to sign on to the virtual machine, using Secure Shell (SSH). 请参阅如何从 Windows从 Linux 和 Mac 进行连接的相关说明。See the instructions on how to connect from Windows or from Linux and Mac. 默认情况下,SSH 允许的并发连接最多为 10 个。By default, SSH allows a maximum of 10 concurrent connections. 通过编辑配置文件,可以增加此数量。You can increase this number by editing the configuration file.

如果遇到问题,请查阅排查安全外壳 (SSH) 连接问题If you're having problems, check out Troubleshoot Secure Shell (SSH) connections.

我是否可以使用临时磁盘 (/dev/sdb1) 存储数据?Can I use the temporary disk (/dev/sdb1) to store data?

不要使用临时磁盘 (/dev/sdb1) 存储数据。Don't use the temporary disk (/dev/sdb1) to store data. 它只是用于临时存储。It is only there for temporary storage. 有丢失无法恢复的数据的风险。You risk losing data that can't be recovered.

我是否可以复制或克隆现有的 Azure VM?Can I copy or clone an existing Azure VM?

是的。Yes. 有关说明,请参阅如何在 Resource Manager 部署模型中创建 Linux 虚拟机的副本For instructions, see How to create a copy of a Linux virtual machine in the Resource Manager deployment model.

创建 VM 后能否向 VM 添加 NIC?Can I add a NIC to my VM after it's created?

能,目前可行。Yes, this is now possible. 首先需停止解除分配 VM。The VM first needs to be stopped deallocated. 然后便可添加或删除 NIC(除非它是 VM 上的最后一个 NIC)。Then you can add or remove a NIC (unless it's the last NIC on the VM).

是否有任何计算机名称要求?Are there any computer name requirements?

是的。Yes. 计算机名称的最大长度为 64 个字符。The computer name can be a maximum of 64 characters in length. 有关命名资源的详细信息,请参阅命名约定规则和限制See Naming conventions rules and restrictions for more information around naming your resources.

是否存在资源组名称要求?Are there any resource group name requirements?

是的。Yes. 资源组名称的最大长度为 90 个字符。The resource group name can be a maximum of 90 characters in length. 有关资源组的详细信息,请参阅命名约定规则和限制See Naming conventions rules and restrictions for more information about resource groups.

创建 VM 时,用户名有什么要求?What are the username requirements when creating a VM?

用户名的长度应为 1 到 32 个字符。Usernames should be 1 - 32 characters in length.

不允许使用以下用户名:The following usernames are not allowed:

  • 1
  • 123
  • a
  • actuser
  • adm
  • admin
  • admin1
  • admin2
  • administrator
  • aspnet
  • backup
  • console
  • david
  • guest
  • john
  • owner
  • root
  • server
  • sql
  • support_388945a0
  • support
  • sys
  • test
  • test1
  • test2
  • test3
  • user
  • user1
  • user2
  • user3
  • user4
  • user5
  • video

创建 VM 时,密码有什么要求?What are the password requirements when creating a VM?

根据所使用的工具,有不同的密码长度要求:There are varying password length requirements, depending on the tool you are using:

  • 门户 - 12 到 72 个字符之间Portal - between 12 - 72 characters
  • PowerShell - 8 到 123 个字符之间PowerShell - between 8 - 123 characters
  • CLI - 12 到 123 个字符之间CLI - between 12 - 123 characters
  • Azure 资源管理器 (ARM) 模板 - 12 到 72 个字符,不允许使用控制字符Azure Resource Manager (ARM) templates - 12 - 72 characters and control characters are not allowed

密码还必须满足以下 4 个复杂性要求中的 3 个要求:Passwords must also meet 3 out of the following 4 complexity requirements:

  • 具有小写字符Have lower characters
  • 包含大写字符Have upper characters
  • 包含一个数字Have a digit
  • 具有特殊字符(正则表达式匹配 [\W_])Have a special character (Regex match [\W_])

不允许使用以下密码:The following passwords are not allowed:

abc@123 P@$$w0rdP@$$w0rd P@ssw0rd P@ssword123 Pa$$wordPa$$word
pass@word1 Password!Password! Password1Password1 Password22Password22 iloveyou!iloveyou!