July 3, 2013 | Written by: David Cox
Share this post:
Why would you want to move images between accounts? For most organizations, a single account is sufficient to manage all images. However, larger organizations may need separation of duties for creation of images, deployment, and management of instances.
In my scenario, we have one organization that is in charge of the base images. This organization creates a snapshot of the image and makes it available to the delivery organizations across the globe. This ensures that each delivery organization is working off of the same image when they provision systems. The separation into different accounts also ensures that the production systems provisioned by each delivery organization are not changed by the global team.
The creation of images is a built in function of the IBM SmartCloud Enterprise (SCE) platform and allows users to create their own images within the portal. These images can be used to re-provision instances in the cloud environment. The limitation of this is that the images can’t be shared across accounts without first transferring them.
A typical set of files and sizes that are required in the transfer are listed below. Depending on the size of the files, the total time from export of the image on account A to import of image on account B can be 20 hours.
In order to distribute images across SCE accounts, the following process must be followed. The document “Transfer image assets between different accounts” describes these steps in detail and can be found in the developerWorks support community.
1. Set up SCE command line tool environment
2. Export image from account A
3. Transfer images from account A to account B
4. Import image into account B
Some of the challenges I ran into when transferring images across SCE accounts:
SCE doesn’t allow the same user ID to have access to multiple accounts. Therefore, two user IDs must be used to transfer the image. The image has to be created and posted on a transfer server by the first user ID. Access to the transfer server for the second user ID is set up by the first user ID. The second user ID is used to connect and transfer the image to a server in the destination account.
The image files that need to be transferred can be very large. Before the files are transferred they should be compressed. This helps solve a couple of issues. The file transfer is one of the longest steps in the procedure. Smaller files will transfer between accounts much faster. The second issue is that the image files are sparse files. This makes them look much larger. Using the -S option on the “tar reduces the size of the files and reduces the time it takes to untar them on the destination system. An example of the tar command to compress and uncompress the files:
Example of tar command:
tar -Szcvf image.tar.gz image
uncompress the file
tar -xSzf image.tar.gz
Transfers of large files over the Internet can be unreliable. One way to mitigate this issue is to break the files up into multiple smaller files. If there is a network failure, breaking the files into smaller chucks allows the transfer to restart without having to start at the beginning. The split command can be used to split the file into smaller files. An example of this command:
split -b 5G image.tgz image.tgz
I’d love to hear any tips you may have to add about the image transfer in SCE.