Search code examples
amazon-ec2aws-opsworks

AWS - EC2 instance stopped and started removed the application code


I usually restart node instance, but since client was complaining speed issue, i read somewhere online and stopped and started the instance. It changed the IP of my instance and the code is all gone.

Now when i ssh, i can see /srv/www but i am not able to get into www folder. Changed the permissions, owner but still www is behaving differently.

Its a ROR application, deployed through aws-opswork


Solution

  • @Undo has the right idea. I haven't checked this in the last version of OpsWorks, but by default OpsWorks managed instances have an instance based store: meaning the storage is destroyed when the instance is stopped.

    In OpsWorks, in the settings for a Layer, you can specify EBS volumes. EBS means Elastic Block Store, which will persist even if the instance is stopped and a new err instance is started.