Created: 2014-05-19 13:22
Updated: 2015-10-06 11:50
License: apache-2.0

The runs the following steps and, once complete, you're able to reference the new HVM-friendly stemcell in your deployment manifests. The script...

  1. starts a PV instance from the supplied PV AMI
  2. starts a HVM instance from the Amazon Linux
  3. stops the PV instance
  4. stops the HVM instance
  5. replaces the HVM root disk with the PV root disk
  6. creates a new image from the HVM instance
  7. destroys the temporary instances and disks
  8. downloads and patches the light-bosh stemcell
  9. uploads the patched stemcell to S3
  10. uploads the patched stemcell to bosh

The whole process typically takes just under 3 minutes.


The script requires four arguments (and the AWS_KEYPAIR_NAME env to be set):

  • the PV AMI (from bosh stemcells)
  • 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 ./ \
    ami-2f05c558 \ \
    ci-logsearch \


  • 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 public-read acl
  • 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.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more