Custom AMI problems: elastic agent doesn't start and ssh fails

Mark Veerman March 26, 2014

I've read through this document, and this document very carefully. I'm starting from a Bamboo stock image, Amazon Linux: S3 x86_64. I make my modifications and bundle/register a new AMI. I then register this new AMI as a new elastic image in the Bamboo OnDemand configuration and try to start a new instance.

The instance starts fine, but the bamboo agent never starts. After a while I see issues like:

- java.io.FileNotFoundException: /home/bamboo/bamboo-agent-home/uuid-temp.properties (No such file or directory)

-java.io.IOException: Could not create directory '/home/bamboo/bamboo-agent-home/classpath'

I think this is due to the /home/bamboo directory not being included in the AMI. I thought the command, /opt/bamboo-elastic-agent/bin/prepareInstanceForSaving.sh, was to work around this issue, but I'm running that prior to creating the AMI and it's still not working.

The second problem I'm seeing is that I'm not able to shh to the instance:

! ssh -i ~/.ssh/elasticbamboo.pk ec2-user@ec2-X-X-X-X.compute-1.amazonaws.com
Permission denied (publickey).

I found this unanswered question on stack-overflow: http://stackoverflow.com/questions/17212459/why-cant-i-create-an-ami-with-ephemeral-storage

And the second link above has some relevant comments. Before I waste anymore time on this can someone let me know if this is even possible?

Thanks,

Mark

1 answer

0 votes
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 26, 2014

Was there any interesting output from prepareInstanceForSaving ?

Did you try using the EBS image?

Mark Veerman March 26, 2014

I haven't tried to use an EBS image yet, but that's the next step if all else fails.

Here's the ouput from prepareInstanceForSaving

[root@domU-... ec2-user]# /opt/bamboo-elastic-agent/bin/prepareInstanceForSaving.sh
Stopping crond:                                            [  OK  ]
Killing all Java processes...
Mounting root device /dev/xvda1 in /tmp/rootDevice15312 to copy data from ephemeral storage...
Copying back /home from ephemeral storage to the root device...
If its your internal image, its safe to just save it now. Otherwise,
you may want to remove some build files/authorisation data/Maven caches from /tmp/rootDevice15312/home/bamboo first.

Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 26, 2014

That looks good. Weird. Try the EBS image.

Mark Veerman March 26, 2014

Using the stock Bamboo amazon linux **EBS** AMI does seem to work, so I'm good to go. That being said, it's pretty clear from the docs I linked to in my post that you claim to support custom AMIs using modified Bamboo S3/instance-store AMIs, so you should upgrade your docs, fix the bug, whatever. I'm certaintly not the only one who's confused or experiencing trouble.

Regardless, I really do appreciate your prompt response to my question.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events