カスタム エラスティック イメージのエージェントのアップグレード
The instructions below are valid if you were using Bamboo 3.4 or newer. If you're upgrading from an earlier version, you should first reinstall the agent installer (see Creating a custom elastic image).
If you customized your instance according to Creating a custom elastic image, your instance will keep itself updated across Bamboo. The synchronization process takes a while and the time required increases as your image gets older. If you notice slow startup, you may want to refresh your image. You can either customize the instance from scratch, as when you created your customized image, or update just the agent data, which is much faster.
To refresh your agent data:
- Start your instance from Bamboo.
- Log into your instance.
- Run /opt/bamboo-elastic-agent/bin/prepareInstanceForSaving.sh.
Create an Image of your Customized Instance.The final step is to create an image from your customized instance. To do this, you will require the following information:
- Amazon Account Number
- Access Key ID
- Secret Access Key
- Amazon S3 bucket name that will be used to store image (if you don't have access to Amazon S3, you can sign up on this page.)
You can create an image of your customized instance by using the
ec2-bundle-volcommand, as follows:
/usr/local/bin/ec2-bundle-vol -c $EC2_CERT -k $EC2_PRIVATE_KEY -u <amazon_account_number> -p <elastic_image_name> --batch --debug
where <elastic_image_name> is the name that you want to assign to your custom image (e.g. 'CustomImage1')
Once the image is created, you need to upload it to Amazon S3 by running the command below:
/usr/local/bin/ec2-upload-bundle -b <s3_bucket_name> -m /tmp/<elastic_image_name>.manifest.xml -a <access_key_id> -s <secret_access_key> --retry --debug
where <s3_bucket_name>, <access_key_id> and <secret_access_key> are the Amazon S3 bucket name, Access Key ID and Secret Access Key described previously, and <elastic_image_name> is the name that you want to assign to your custom image (e.g. 'CustomImage1')
You will then need to register your image with Amazon EC2 by using the
where <s3_bucket_name> is the Amazon S3 bucket name described previously and <elastic_image_name> is the name that you want to assign to your custom image (e.g. 'CustomImage1')
The output of this command will show the AMI ID of your custom image.
Associate the new Custom Image with Bamboo.
Finally, you will need to associate your custom elastic image with your Bamboo installation by creating an Elastic Image Configuration. Please note the AMI ID of your new custom image and read Managing your elastic image configurations for further instructions.