2
respostas

Não monta "/vagrant" na AWS

Tive que fazer duas alterações em relação ao exercício da aula 6 para subir a máquina na AWS:

  1. incluí uma tag ws.region = 'us-west-2' que não constava no roteiro
  2. usei uma máquina Ubuntu 16.04 LTS 64 bits, pois não havia 32 bits disponível

Com isso a máquina subiu, porém a pasta /vagrant não está aparecendo na VM.

Mensagem que aparece quando faço um vagrant up --provider=aws:

$ vagrant up --provider=aws
Bringing machine 'web' up with 'aws' provider...
==> web: Warning! The AWS provider doesn't support any of the Vagrant
==> web: high-level network configurations (`config.vm.network`). They
==> web: will be silently ignored.
==> web: Launching an instance with the following settings...
==> web:  -- Type: m3.medium
==> web:  -- AMI: ami-db710fa3
==> web:  -- Region: us-west-2
==> web:  -- Keypair: devops
==> web:  -- Security Groups: ["devops"]
==> web:  -- Block Device Mapping: []
==> web:  -- Terminate On Shutdown: false
==> web:  -- Monitoring: false
==> web:  -- EBS optimized: false
==> web:  -- Source Destination check: 
==> web:  -- Assigning a public IP address in a VPC: false
==> web:  -- VPC tenancy specification: default
==> web: Waiting for instance to become "ready"...
==> web: Waiting for SSH to become available...
==> web: Machine is booted and ready for use!
No host IP was given to the Vagrant core NFS helper. This is
an internal error that should be reported as a bug.

Este é meu Vagrantfile:

Vagrant.configure("2") do |config|

  config.vm.box = "ubuntu_aws"
  config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"

  config.vm.provider :aws do |aws, override|
     aws.access_key_id = "(omiti)"
     aws.secret_access_key = "(omiti)"
     aws.region = 'us-west-2'

     aws.keypair_name = "devops"
     aws.ami = "ami-db710fa3"
     aws.security_groups = ['devops']

     override.ssh.username = "ubuntu"
     override.ssh.private_key_path = "devops.pem"

  end

  config.vm.define :web do |web_config|
     web_config.vm.network "private_network", ip: "192.168.50.10"

     web_config.vm.provider :aws do |aws|
        aws.tags = { 'Name' => 'MusicJungle (vagrant)'}
     end

     web_config.vm.provision "puppet" do |puppet|
        puppet.manifest_file = "web.pp"
     end
   end

end
2 respostas

Segundo https://github.com/hashicorp/vagrant/issues/5401 trata-se de um bug do plugin AWS, que pode ser contornado com incluindo a cláusula:

config.vm.provider :aws do |aws, override|
   override.nfs.functional = false

Com esta cláusula conseguir resolver meu problema

Oi Fabiano, tudo bem? Esse bug era relativo ao problema da pasta que não era montada?

Puxa, fico feliz que você tenha compartilhado aqui com a gente a solução.

A AWS mudou um pouco desde a publicação do curso aparentemente.

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software