![]() ![]() Where ‘true’ means “yes, please, delete me when I’m done.” This command throws a stack trace to the tune of Unexpected error: : .client.InstanceBlockDeviceMappingDescriptionĬannot be cast to .client.InstanceBlockDeviceMappingResponseDescriptionīut it works, that’s just a lame API tools bug. If you don’t want certain EBS-backed drives to persist, what you do is of the form: ec2-modify-instance-attribute -block-device-mapping "/dev/sdb=vol-f64c8e9f:true" i-e2a0b08a By default, all EBSes are persistent and stick around muddying up your account till you clean them up. Opinion is split among the Linuxerati about whether you want swap space nowadays or not some people say some mix of “if you’re using more than 1.8 GB of RAM you’re doing it wrong” and “swapping is horrid, just let bad procs die due to lack of memory and fix them.” YMMV.Īs another helpful tip, let’s say you’re adding an EBS to an image that you don’t want to be persistent when the instance dies. block-device-mapping '/dev/sda3=ephemeral1' -snapshot your-snapname -architecture i386 Add a fstab like the one above and when you create the image, do it like this, using the exact same –block-device-mapping flag: ec2-register -n -d "AMI Description" -block-device-mapping /dev/sda2=ephemeral0 On the instance you have to mount them – add these to /etc/fstab and mount -a or do whatever else it is you like to do: /dev/sda3 swap swap defaults 0 0Īnd if you want to turn the swap on immediately, “swapon /dev/sda3”. block-device-mapping '/dev/sda3=ephemeral1' To add them to an EBS instance and mount them in the “normal” places, you do: ec2-run-instances -k -block-device-mapping '/dev/sda2=ephemeral0' ![]() For a small image, it has an ephemeral0 (ext3, 15 GB) and an ephemeral1 (swap, 1 GB). – they don’t tell you explicitly which is which but basically you just count up based on your instance type ( review the doc). You refer to the ephemeral chunks as “ephemeral0”, “ephemeral1”, etc. You just have to set the block devices up either explicitly when you run the instance or bake them into the image. The ephemeral storage is still available and can be used (for free!) by an EBS-backed image. The good news is, that’s just by default. But when you pull up an EBS image, these ephemeral disk areas are not available to you. ![]() None 873828 0 873828 0% /dev/shm ~]# freeīut, you say, I am not old or insane! I use EBS-backed images, just as God intended. (mount points vary by image, but that’s where they are in the Amazon Fedora starter.) ~]# df -k Filesystem 1K-blocks Used Available Use% Mounted on The upshot is that if you start an “instance-store” small Linux EC2 instance, it automagically has a free 150 GB /mnt disk and a 1 GB swap partition up and runnin’ for ya. The storage location and format also varies by instance size and is defined here. The amount of space varies by instance size and is defined here. When you start an “instance-store” Amazon EC2 instance, you get a certain amount of ephemeral storage allocated and mounted automatically. Here’s a couple tidbits I’ve gleaned that are useful. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |