convert.sh runs the following steps and, once complete, you're able to reference the new HVM-friendly stemcell in your deployment manifests. The script...
- starts a PV instance from the supplied PV AMI
- starts a HVM instance from the Amazon Linux
- stops the PV instance
- stops the HVM instance
- replaces the HVM root disk with the PV root disk
- creates a new image from the HVM instance
- destroys the temporary instances and disks
- downloads and patches the light-bosh stemcell
- uploads the patched stemcell to S3
- uploads the patched stemcell to bosh
The whole process typically takes just under 3 minutes.
convert.sh script requires four arguments (and the AWS_KEYPAIR_NAME env to be set):
- the PV AMI (from
- the correlating light-bosh stemcell (from
bosh public stemcells --full)
- the S3 bucket for uploading the patched stemcell
- the S3 key for uploading the patched stemcell
AWS_KEYPAIR_NAME=labs-commander ./convert.sh \ ami-2f05c558 \ https://bosh-jenkins-artifacts.s3.amazonaws.com/bosh-stemcell/aws/light-bosh-stemcell-2549-aws-xen-ubuntu-trusty-go_agent.tgz \ ci-logsearch \ bosh-stemcell/aws/light-bosh-stemcell-2549-aws-xen-ubuntu-trusty-go_agent-hvm.tgz
- this utilizes the
awscli- make sure it's installed and your AWS credentials are available to it
- the PV AMI is specific to your bosh deployment (you'll need to replace the first argument in the example for it to work for you)
- if an error occurs, the script will fail and you'll need to manually clean up resources (resource IDs are output as they are created)
- the patched light-bosh stemcell is uploaded to S3 with the
- this is a naive conversion process - this does not deal with OS or kernel changes to fully take advantage of HVM virtualization
Copyright 2014 City Index Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.