使用 Azure 配置 Vagrant 时出现 Vagrant up 问题

使用 Azure 配置 Vagrant 时出现 Vagrant up 问题

我正在 Windows 机器上配置 Vagrant 和 azure。运行 vagrant up 命令时遇到以下问题

此计算机的配置存在错误。请修复以下错误并重试:Microsoft Azure 提供程序:* 以下设置不应存在:vm_image

如果我通过禁用 vagrant 文件中的 Vm_image 来运行相同的命令,则会遇到以下问题

**"body": "{\r\n  \"error\": {\r\n    \"code\": \"NotFound\",\r\n    \"message

\:\“Artifact:未找到 VMImage。\”\r\n }\r\n}“,”headers“:{”cache-control“:”no-cache“,”pragma“:”no-cache“,”content-length“:”99“,”content-type“:”application/json; charset=utf-8“,”expires“:”-1“,”strict-transport-security“:”max-age=31536000; includeSubDomains“,”x-ms-request-id“:”553a43ab-efe6-4250-9b6d-9ab5aa9493f3“,”server“:”Microsoft-HTTPAPI/2.0,Microsoft-HTTPAPI/2.0“,”x-ms-ratelimit-remaining-subscription-reads“:”14996“,”x-ms-correlation-request-id“: “b5f9cee2-6dfc-4e89-abf7-72d2cca84ff1”,“x-ms-routing-request-id”:“东南亚:20170103T072604Z:b5f9cee2-6dfc-4 e89-abf7-72d2cca84ff1”,“日期”:“2017 年 1 月 3 日星期二 07:26:04 GMT”,“连接”:“关闭”},“状态”:404 }**

流浪文件:

Vagrant.configure('2') do |config|
  config.vm.box = 'azure'
  #config.vm.box_url = 'https://github.com/msopentech/vagrant-azure/raw/master/dummy.box'

  # use local ssh key to connect to remote vagrant box
  #config.ssh.private_key_path = '~/.ssh/id_rsa'
  config.vm.provider :azure do |azure, override|
    # use Azure Active Directory Application / Service Principal to connect to Azure

    # each of the below values will default to use the env vars named as below if not specified explicitly
    #azure.mgmt_certificate = 'enterprise_dev-test-1-2-2017-credentials.pem'
    #azure.mgmt_endpoint = 'xxxxxxx'
    azure.subscription_id  = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    azure.tenant_id = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
    azure.client_id = 'zzzzzzzzzzzzzzzzzzzzzzzzzz'
    azure.client_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    #azure.vm_image='a699494373c04fc0bc8f2bb1389d6106__Win2K8R2SP1-Datacenter-20161214-en.us-127GB.vhd'
    azure.vm_name = 'box01'
    #azure.tcp_endpoints = '3389:53390'
  end
  config.ssh.username         = 'vagrant'
  #config.ssh.private_key_path = 'C:/Users/skannan/.vagrant.d/insecure_private_key'
  config.vm.provision "shell", inline: "echo hello"
  #config.vm.synced_folder "./vagrant", "/vagrant"
  config.vm.network :private_network, ip: "172.17.1.100", type: "dhcp"
end

答案1

这仅仅意味着您请求的图像不可用,或者您所在地区不可用。这种情况的常见根本原因是遵循过时的文档!尝试

az vm image list

从中选择一个

相关内容