繁体   English   中英

在Packer中构建AMI,包括使用Packer修改的快照

[英]Build AMI in packer including modified snapshot with packer

我想用两个块设备构建一个AMI,在配置期间会对其进行修改。 当我使用打包程序创建AMI时,它似乎并不会拍摄块设备的新快照。 有办法强制吗?

我的模板是{ "builders": [{ "type": "amazon-ebs", "region": "us-east-1", "source_ami": "ami-08842d60", "instance_type": "m4.2xlarge", "security_group_id": "<redacted>", "subnet_id" : "<redacted>", "ssh_username": "ec2-user", "ssh_pty": true, "ami_name": "testing {{timestamp}}", "ami_block_device_mappings": [{ "device_name": "/dev/sdf", "volume_type": "gp2", "volume_size": 100, "delete_on_termination": true, "encrypted": true }, { "device_name": "/dev/sdg", "volume_type": "gp2", "volume_size": 100, "delete_on_termination": true, "encrypted": true }] }] }

问题是我使用的是ami_block_device_mappings而不是launch_block_device_mappings 前者仅添加到AMI,而不添加到启动实例。 launch_block_device_mappings将添加到构建AMI的实例中,并将被快照并添加到已注册的AMI中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM