Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 使用Chef solo+;瓦格兰+;AWS&x2B;MacOSX_Amazon Web Services_Chef Infra_Vagrant_Chef Solo - Fatal编程技术网

Amazon web services 使用Chef solo+;瓦格兰+;AWS&x2B;MacOSX

Amazon web services 使用Chef solo+;瓦格兰+;AWS&x2B;MacOSX,amazon-web-services,chef-infra,vagrant,chef-solo,Amazon Web Services,Chef Infra,Vagrant,Chef Solo,我打算用Wagrant,Chef solo来建立一个AWS环境。但是我遇到了一些我无法解决的错误。有人能帮我吗 我使用的步骤: 在Mac OS X上安装所有必要的环境:如vagrant、vagrant插件、virtual box、chef、chef插件等 下载vagrant配置文件: git clone https://github.com/ICTatRTI/ict-chef-repo vagrant文件 # -*- mode: ruby -*- # vi: set ft=ruby : Va

我打算用Wagrant,Chef solo来建立一个AWS环境。但是我遇到了一些我无法解决的错误。有人能帮我吗

我使用的步骤:

  • 在Mac OS X上安装所有必要的环境:如vagrant、vagrant插件、virtual box、chef、chef插件等

  • 下载vagrant配置文件:

    git clone https://github.com/ICTatRTI/ict-chef-repo
    
  • vagrant文件

    # -*- mode: ruby -*-
    # vi: set ft=ruby :
    Vagrant.configure("2") do |config|
      # All Vagrant configuration is done here. The most common configuration
      # options are documented and commented below. For a complete reference,
      # please see the online documentation at vagrantup.com.
      #config.vm.box_url = "https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_chef-11.2.0.box"
      #config.vm.box = "opscode-ubuntu-1204"
      config.vm.box = "dummy"
      config.vm.network :forwarded_port, guest: 80, host: 8888
      config.vm.network :forwarded_port, guest: 3306, host: 3333
      config.ssh.username = "ubuntu"
    
      config.vm.provider :aws do |aws, override|
      #config.vm.provider :aws do |aws|
        aws.access_key_id     = 'XXXXXXXXXXXXXXXQ'
        aws.secret_access_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
        aws.keypair_name = "usr-aws-2013"
        aws.availability_zone = "us-west-2c"
        aws.instance_type = "t1.micro"
        aws.region = "us-west-2"
        aws.ami = "ami-0849a03f"
        aws.security_groups = ['quicklaunch-1']
        aws.tags = { 
          'Name' => 'tong',
          'Description' => 'vagrant test'
        } 
        override.ssh.private_key_path = "~/.ssh/usr-aws-2013.pem"
        override.ssh.username = "ubuntu"
      end
      config.vm.provision :chef_solo do |chef|
    
         chef.node_name = 'base' 
         chef.cookbooks_path = "./cookbooks"
         chef.roles_path = "./roles"
         chef.add_role "base"
         chef.add_role "ushahidi"
       end
    
    end
    
  • 运行:

    vagrant up --provider=aws
    
  • 得到以下错误

    Bringing machine 'default' up with 'aws' provider...
    WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1
    [default] Warning! The AWS provider doesn't support any of the Vagrant
    high-level network configurations (`config.vm.network`). They
    will be silently ignored.
    [default] Launching an instance with the following settings...
    [default]  -- Type: t1.micro
    [default]  -- AMI: ami-0849a03f
    [default]  -- Region: us-west-2
    [default]  -- Availability Zone: us-west-2c
    [default]  -- Keypair: usr-aws-2013
    [default]  -- Security Groups: ["quicklaunch-1"]
    [default]  -- Block Device Mapping: []
    [default]  -- Terminate On Shutdown: false
    An error occurred while executing multiple actions in parallel.
    Any errors that occurred are shown below.
    
    An unexpected error ocurred when executing the action on the
    'default' machine. Please report this as a bug:
     The image id '[ami-0849a03f]' does not exist
    

  • 实例AMI是不同的事物,它们也有不同的数字。因此,如果你有i-bddcf889,你就不能在你的文件中引用它作为ami-bddcf889


    相反,您不必手动创建/启动实例-您必须提供ami,Vagrant将从该ami创建实例本身。例如,以您手动创建的实例为例。

    看起来很明显:在提供的区域和区域中没有“ami-0849a03f”,或者您可能无法访问它。Hi@DracoAter我正在AWS EC2控制台中创建一个实例,我确保有一个实例看起来像“I-bddcf889 t1.micro us-west-2b running”,我更改了该文件“aws.availability\u zone=“us-west-2b”aws.instance\u type=“t1.micro”aws.region=“us-west-2”aws.ami=“ami-bddcf889”“但它显示了相同的错误,很抱歉,迟了回复,但我们之间似乎有几个时差。你是对的,我完全误解了。但是我怎样才能正确地得到这个ami号码和地区呢?我找到了一个网站,可以找到ami,但我真的不知道如何使用它,这些ami之间的引导文件有什么区别吗?这些[链接]应该没有任何区别,如果操作系统仍然是相同类型的(Linux、Windows、Mac),在我的AWS控制台页面中,我发现“您没有任何符合筛选条件的图像。请使用上面的筛选控件查看Amazon和其他人拥有的图像。”在AMIs标记中,我需要在其中创建/导入AMI吗?你能告诉我怎么做吗?搜索亚马逊和其他公司拥有的图片-它们是公开的非常感谢~我知道了~它可以工作!