mitchellh / vagrant-aws

Use Vagrant to manage your EC2 and VPC instances.
MIT License
2.61k stars 574 forks source link

Cannot provision instances with EBS size greater than 1000Gb (1Tb) #547

Closed clintval closed 5 years ago

clintval commented 6 years ago

I am having the same problem as described here: https://github.com/saltstack/salt/issues/29327

When provisioning an instance with greater than 1000Gb my instance starts and stops immediately. The solution in the above issue was to manually specify the Volume Type. Doing that with vagrant-aws does not solve the problem. Here is the VagrantFile:

require 'vagrant-aws'
require 'vagrant-env'

Vagrant.configure('2') do |config|
  config.env.enable
  config.vm.box = 'aws-dummy'
  config.vm.provider 'aws' do |aws, override|
    aws.ami                    = ENV['AWS_AMI']
    aws.instance_type          = ENV['AWS_INSTANCE_TYPE']
    aws.keypair_name           = ENV['AWS_KEYPAIR_NAME']
    aws.region                 = ENV['AWS_REGION']
    aws.access_key_id          = ENV['AWS_ACCESS_KEY_ID']
    aws.secret_access_key      = ENV['AWS_SECRET_ACCESS_KEY']
    aws.security_groups        = ['SSH From Anywhere']
    aws.instance_ready_timeout = 180  # seconds

    aws.block_device_mapping   = [
      {
        'DeviceName' => '/dev/sda1',
        'Ebs.VolumeSize' => 1001,
        'Ebs.VolumeType' => 'gp2',
        'Ebs.DeleteOnTermination' => true
      }
    ]

    aws.tags                    = {
        'Name'  => ENV['AWS_INSTANCE_TAG_NAME'],
        'Owner' => ENV['AWS_INSTANCE_TAG_OWNER']
    }

    override.ssh.username         = 'ec2-user'
    override.ssh.private_key_path = ENV['PRIVATE_KEY_PATH']
  end

  config.vm.provision 'ansible' do |ansible|
    ansible.playbook = 'playbook.yml'
    ansible.compatibility_mode = '2.0'
  end
end

Has anyone encountered this bug and know of a fix?

Thanks for the great utility!

clintval commented 5 years ago

Solved, I had the device name wrong when it should have been /dev/xvda.

This works:


    aws.block_device_mapping   = [
      {
        'DeviceName' => '/dev/xvda',
        'Ebs.VolumeSize' => 1001,
        'Ebs.VolumeType' => 'gp2',
        'Ebs.DeleteOnTermination' => true
      }
    ]