【问题标题】:How to spin up an Azure VM with a cheap (non geo-redundant) system disk?如何使用廉价(非地理冗余)系统磁盘启动 Azure VM?
【发布时间】:2025-12-24 12:45:06
【问题描述】:

我使用 azure xplat 命令行工具和一些 bash 脚本来生成工作虚拟机,在其上处理 CPU/内存绑定的计算工作负载并再次将其拆除。

我生成这样的机器:

azure vm create --location 'West Europe' --vm-size extralarge [...] b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140724-en-us-30GB

到目前为止,一切正常。查看我的按需付费订阅列表,我发现使用了相当多的 geo-redundant 存储,即第二昂贵的存储选项。

如何调整我的设置以使用最便宜的 blob 存储选项(如果我没记错的话,“本地冗余”)?

半相关:我也很高兴有其他关于如何通过这种工作负载省钱的技巧,即创建和使用最小的 Linux 映像(不是 30gb)可能会有所帮助?

【问题讨论】:

    标签: azure scripting disk azure-cloud-services azure-xplat-cli


    【解决方案1】:

    首先使用您想要的设置创建您的存储帐户,例如禁用异地复制。例如,以下是在禁用异地复制的情况下在美国东部创建存储帐户的方法。

    azure storage account create <your storage acct name> -l "East US" --disable-geoReplication
    

    然后,为您的订阅设置存储帐户

    azure storage account set <your storage acct name>
    

    然后,使用 azure vm create 创建您的虚拟机。

    【讨论】:

      【解决方案2】:

      不需要设置 Azure 存储帐户。它用于设置/更新存储帐户的属性。没有将特定存储帐户设置为该订阅的默认帐户的概念。

      以下是解释其用途的命令帮助:

      azure storage account set -h
      help:    Update a storage account
      help:
      help:    Usage: storage account set [options] <name>
      help:
      help:    Options:
      help:      -h, --help                       output usage information
      help:      -v, --verbose                    use verbose output
      help:      --json                           use json output
      help:      -e, --label <label>              the storage account label
      help:      -d, --description <description>  the storage account description
      help:      --geoReplication                 indicates if the geo replication is enabled
      help:      --disable-geoReplication         indicates if the geo replication is disabled
      help:      -s, --subscription <id>          the subscription id
      

      【讨论】:

      • 如果您自己没有创建存储帐户,这是否意味着默认使用异地冗余?因为在遵循@Rick 的回答之后,我的 VHD 按预期存储在新的、仅本地冗余的容器中。