[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revisionLast revision | |||
— | howtos:cloud:aws_ec2 [2020/07/07 00:56 (UTC)] – [Security] bifferos | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | ||
+ | ====== Slackware as an AWS EC2 Instance ====== | ||
+ | ===== Prerequisites ===== | ||
+ | |||
+ | * You should have already prepared a DomU compatible Slackware install, see the [[howtos: | ||
+ | * You should have an AWS account with the necessary [[https:// | ||
+ | * You should have awscli configured with credentials such that commands like 'aws s3 ls' work | ||
+ | |||
+ | That's the bare minimum. | ||
+ | |||
+ | ===== Security ===== | ||
+ | |||
+ | A quick word about security. | ||
+ | |||
+ | - Upload a public key to the account you'll use to access your instance, e.g. with [[https:// | ||
+ | - Ensure that ssh is configured to only use key access ([[https:// | ||
+ | - Reboot and ensure you still have access using your private key. | ||
+ | - Double-check that you cannot login using the password that would normally work on the VM console for your user. | ||
+ | <note important> | ||
+ | |||
+ | ===== Disk Formats ===== | ||
+ | |||
+ | You now need to consider in what format you'll upload your Slackware DomU hard disk image. | ||
+ | |||
+ | Stream optimised VMDK is the most efficient way to upload your image. | ||
+ | |||
+ | If you don't have VMWare, and/or don't want to use OVFTool then you should consider .VHD format. | ||
+ | |||
+ | You can also use the RAW format, but you'd have to be some kind of lunatic to do that since you'll be waiting forever for your upload. | ||
+ | |||
+ | ===== Snapshot import ===== | ||
+ | |||
+ | The snapshot import process is [[https:// | ||
+ | |||
+ | Having generated a hard disk image in the appropriate format you will need to put it in an S3 bucket. | ||
+ | |||
+ | Once uploaded, generate a presigned URL for it using the ARN (Amazon Resource Name) of the bucket item, e.g. | ||
+ | |||
+ | < | ||
+ | aws s3 presign s3:// | ||
+ | </ | ||
+ | |||
+ | Copy the printed (generated) URL somewhere. | ||
+ | |||
+ | Create file containers.json containing something like this. | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Change vmdk to vhd(x) depending on the format you’re using (it’s not detected by the import process). | ||
+ | |||
+ | < | ||
+ | aws ec2 import-snapshot --description " | ||
+ | </ | ||
+ | |||
+ | Again, note my description has a version, I found this handy when looking at logs, and checking on tasks etc… | ||
+ | |||
+ | Take a note of the printed ImportTaskId (or any error!!!) after running that command. | ||
+ | |||
+ | Monitor the task by repeatedly running something like: | ||
+ | |||
+ | < | ||
+ | aws ec2 describe-import-snapshot-tasks --import-task-ids import-snap-02da847264756b9f3 | ||
+ | </ | ||
+ | |||
+ | Once this import has completed (should take about half an hour for Slackware disk sets A, AP, D, K, L, N), take a copy of the final status snapshot ID, as we’ll need it e.g.: | ||
+ | |||
+ | < | ||
+ | " | ||
+ | </ | ||
+ | |||
+ | ===== Connect to an Instance ===== | ||
+ | |||
+ | You can now create an instance. | ||
+ | |||
+ | You can then use the AWS Console to create an EBS volume from your uploaded snapshot, and attach the EBS volume as the root device of your instance. | ||
+ | |||
+ | You should now be able to start that instance, boot Slackware and connect to it using ssh. | ||
+ | |||
+ | ====== Sources ====== | ||
+ | <!-- Authors are allowed to give credit to themselves! --> | ||
+ | * Originally written by [[wiki: | ||
+ | |||
+ | <!-- Please do not modify anything below, except adding new tags.--> | ||
+ | <!-- You must remove the tag-word " | ||
+ | {{tag> |