0

I have an AMI image I'd like to update, i.e. start an instance from it, do some edits/updates, and save a new AMI from the instance. But while I do my edits I don't need the full system running, I only need ssh access.

I wonder if I can set something in the "user data" attribute of the instance so that cloud-init runs the instance in a maintenance mode with only sshd, and no other services started.

My target distributions are Debian 7.x, 8.x and Ubuntu 14.04LTS (it makes any difference).

gdamjan
  • 160
  • 1
  • 4

1 Answers1

1

Launch a generic AMI of the OS you run then attach a volume with your data to that instance. You will need to mount it, unmount it, terminate that instance when done, etc. Then rebuild your custom AMI using a snapshot of the edited volume and like settings from the previous AMI. There is no way around the need for a new snapshot, new AMI, to make any change like this. Keep the OLD ones until you verify that the new one works.

Skaperen
  • 1,094
  • 2
  • 11
  • 23
  • also now is a good time to redesign your AMI so it lets you start it in maintenane mode by some choice of input such as user data. – Skaperen Feb 05 '15 at 13:01