运行vagrant up命令时出错

时间:2016-12-14 12:40:32

标签: azure vagrant

我正在研究用流浪汉配置天蓝色的盒子。我按照以下链接https://stapp.space/setup-vagrant-with-azure/中提到的步骤创建了流浪文件。在最后运行vagrant up命令我面临以下错误enter code here 本机的配置存在错误。请修理 出现以下错误并再试一次:

Microsoft Azure提供商: *以下设置不应存在:mgmt_certificate,mgmt_endpoint,ssh_c ertificate_file,ssh_port,ssh_private_key_file,vm_image,vm_location *您必须通过ENV或Vagrantfile提供Azure Active Directory租户ID,应用程序客户端ID和应用程序客户端密钥。

Vagrant档案:

VAGRANTFILE_API_VERSION = '2'

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

  config.ssh.username         = 'vagrant'
  config.ssh.private_key_path = File.expand_path('C:\Windows\System32\cert.pem')

  config.vm.provider :azure do |azure|
    azure.mgmt_certificate = File.expand_path('C:\Windows\System32\cert.pem')
    azure.mgmt_endpoint    = 'https://management.core.windows.net'
    azure.subscription_id  = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

    azure.cloud_service_name = 'Windows Azure MSDN - Visual Studio Ultimate(Converted to EA)12-9-2016-credentials'
    azure.storage_acct_name  = 'Windows Azure MSDN - Visual Studio Ultimate(Converted to EA)'
    azure.deployment_name    = 'azurevagrantdeployment'

    azure.vm_name     = 'azurevagrantsmall1'
    azure.vm_password = 'vagrant123'
    azure.vm_image    = '03f55de797f546a1b29d1b8d66be687a__VS-2017-RC1-Comm-WS2012R22016-11-16 '
    azure.vm_size     = 'Small'
    azure.vm_location = 'North Europe'


    azure.ssh_port             = '22'   
    azure.ssh_private_key_file = File.expand_path('C:\Windows\System32.pem')
    azure.ssh_certificate_file = File.expand_path('C:\Windows\System32.cer')

    azure.tcp_endpoints = '8000'
  end

  config.vm.provision 'shell', inline: 'echo OHAI'
end

请提供最佳解决方案

机器配置:Windows 8.1 64位

2 个答案:

答案 0 :(得分:1)

这是该插件以前版本的一些文档。

你应该查看github readme document - 你的流浪文件看起来像

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

  config.ssh.username         = 'vagrant'
  config.ssh.private_key_path = File.expand_path('C:\Windows\System32\cert.pem')

  config.vm.provider :azure do |azure, override|

    # use Azure Active Directory Application / Service Principal to connect to Azure
    # see: https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/

    # each of the below values will default to use the env vars named as below if not specified explicitly
    azure.tenant_id = ENV['AZURE_TENANT_ID']
    azure.client_id = ENV['AZURE_CLIENT_ID']
    azure.client_secret = ENV['AZURE_CLIENT_SECRET']
    azure.subscription_id = ENV['AZURE_SUBSCRIPTION_ID']
  end

end

答案 1 :(得分:1)

是的,如果我删除其他可选项,则会找不到图像。

“回复”:{     “body”:“{\ r \ n \”错误\“:{\ r \ n \”代码\“:\”NotFound \“,\ r \ n \”消息\“:\”神器:VMImage不是找到。\” \ r \ n} \ r \ n}“,     “标题”:{       “缓存控制”:“无缓存”,       “pragma”:“no-cache”,       “内容长度”:“99”,       “content-type”:“application / json; charset = utf-8”,       “到期”:“ - 1”,       “strict-transport-security”:“max-age = 31536000; includeSubDomains”,       “x-ms-request-id”:“xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,       “server”:“Microsoft-HTTPAPI / 2.0,Microsoft-HTTPAPI / 2.0”,       “x-ms-ratelimit-remaining-subscription-reads”:“14998”,       “x-ms-correlation-request-id”:“yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyyy”,       “x-ms-routing-request-id”:“SOUTHEASTASIA:20170102T093102Z:yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyyy”,       “日期”:“星期一,2017年1月2日09:31:02 GMT”,       “连接”:“关闭”     },     “身份”:404   } }

相关问题