The Wayback Machine - https://web.archive.org/web/20120615233131/http://www.ibm.com:80/developerworks/cloud/library/cl-smartcloudsolution2/index.html
Skip to main content

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

All information submitted is secure.

  • Close [x]

Create solutions on IBM SmartCloud Enterprise: Transfer image assets between different accounts

A step-by-step guide to transferring an image from one account to another

Chun Feng Wu (wucf@cn.ibm.com), Staff Software Engineer, IBM
Chun Feng Wu is an IBM Certified Solution Advisor and an IBM Certified Solution Architect for cloud computing. He worked on the IBM public cloud, SmartCloud Enterprise and now works on IBM managed cloud, SmartCloud Enterprise Plus.
Yi Shuai Wang (wangyis@cn.ibm.com), Advisory Architect, IBM
Yi Shuai Wang is an Advisory Architect at IBM and lead developer for the development of the business support services of IBM SmartCloud Enterprise.
Liu Guo Ning (liuguon@cn.ibm.com), Staff Software Engineer, IBM
Guo Ning Liu is a staff software engineer with the IBM SmartCloud Enterprise development team, IBM China Development Lab. Since 2009 Liu Guo has been working with provisioning and managing images for IBM Smart Cloud Enterprise.
Alex Amies (aamies@cn.ibm.com), Senior Software Engineer, IBM
Alex Amies photo
Alex Amies is a senior software engineer in the IBM GTS Development Lab in the China development lab. He is currently an architect working on the design of the IBM SmartCloud Enterprise. Previously, he acted as an architect and a developer on cloud and security products in other groups within IBM.

Summary:  IBM® SmartCloud Enterprise is an agile cloud computing Infrastructure as a Service designed to provide rapid access to security-rich, enterprise-class virtual server environments, well suited for development and test activities and other dynamic workloads. On IBM SmartCloud Enterprise, images are important assets that are the base of virtual machines that the user can provision. Users can have different accounts for different purposes on the cloud among which they would like to share private image assets to avoid duplication of their efforts. In this article, the authors provide a step-by-step guide to transferring an image from one account to another on IBM SmartCloud Enterprise.

View more content in this series

Date:  06 Jun 2012
Level:  Intermediate PDF:  A4 and Letter (1156 KB | 24 pages)Get Adobe® Reader®

Activity:  4470 views
Comments:  

IBM SmartCloud Enterprise accounts are enabled in such a way that shared images are only visible from within the same account. Usually, the shared images are images customized by the enterprise to fulfill specific business needs, but there are more and more cases in which a customer has different SmartCloud Enterprise accounts for different purposes (such as development, pre-production, production, testing), and the customer wants to share such private image assets among different accounts to both protect the assets and avoid duplicate work effort. Note, the user is responsible to ensure all actions are legal within the terms and conditions of the software component.

IBM SmartCloud Enterprise 2.0 provides an amazing solution for such requirements. This article provides a step-by-step guide to transferring an image from one account to another. One prerequisite for this task is that the operator has to have the credentials for both accounts.

The business scenario used in this article is as follows:

  • An organization has two accounts in SmartCloud Enterprise: One is for testing (accountA in Research Triangle Park, North Carolina data center) and the other is for production (accountB in Boulder, Colorado data center).
  • Users prepare and validate an image in the testing account; when done, the image is ready for production deployment.

To save the duplicated effort of preparing an identical image for the production account, the user can adopt the documented steps here to transfer an image from his testing account (accountA) to his production account (accountB).

Descriptions of the resources used in this article are listed in Table 1.


Table 1. Resource references in this article
Resource typeInformation regarding transfer fromInformation regarding transfer to
Data CenterRTP data centerBoulder data center
AccountAccountAAccountB
Login IdidA@cn.ibm.comidB@cn.ibm.com
Instance NameinstanceA (be captured)instanceB (be provisioned based on transferred image)
Image Nameto_be_transferred_image (captured from instanceA)transferred_image (same copy of to_be_transferred_image)
Instance name of storage serverstorage_server_accountA (Redhat 6, 170.224.165.60)storage_server_accountB (Redhat 6, 170.225.100.188)
Key name of storage serverkey_accountAkey_accountB
Persistent storage namestorageA (ext3)storageB (ext3)

Task 1: Set up the SmartCloud command line tool environment

In addition to the user interface, a command line tool is provided to access the SmartCloud service. Currently, some features are only available through a command line tool, such as image copy-to and import, which are the necessary steps to transfer images.

The SmartCloud command line tool runs on JRE (Java™ Runtime Environment), so make sure you have JRE in place before issuing any SmartCloud command. The steps assume all SmartCloud commands are issued from a single machine (Windows® XP machine in these steps).

Step 1: Set up the JDK runtime

Download JDK 1.6 (Java Development Kit) from http://java.com/en/download/index.jsp; make sure you set the JAVA_HOME variable accordingly.

After installation, run java -version to check that it installed successfully. If you find a class not found exception, it could be caused by having the wrong JRE installed.

Step 2: Set up the SmartCloud command line tool

To utilize SmartCloud commands, you have to download the latest SmartCloud command line tool by accessing the SmartCloud Enterprise Support tab. You must be logged in to IBM SmartCloud Enterprise to download the command line tool. Figure 1 shows the Command Line Tool Reference link.


Figure 1. SmartCloud Enterprise Support tab
SmartCloud Enterprise Support tab

The command line tool is maintained by the IBM asset management system. You are directed to an asset management page after you click Command Line Tool Reference.

Figure 2 shows the Command Line Tool asset page. Click Download this Asset to download the SmartCloud command line tool.


Figure 2. Download link for the Command Line Tool
Download link for the command line tool

You should see a DeveloperCloud_CMD_Tool.zip file after extracting Command Line Tool Reference and Binaries.zip file; this is where the SmartCloud command line files are. You should further extract the DeveloperCloud_CMD_Tool.zip into a path that doesn't contain any spaces, for example, C:\DeveloperCloud_CMD_Tool.

The GA_CommandLine.pdf file is a help document containing the commands mentioned in this article. The pdf file is in the Command Line Tool Reference and Binaries.zip file.

To facilitate and secure operations on SmartCloud through the SmartCloud command line tool, you should create a password protection file for each login credential (Listings 1 and 2). The path, C:\DeveloperCloud_CMD_Tool\keys is used in this example. Please note, we created the directory "keys" ourselves in advance.


Listing 1. Create protection file for idA
C:\DeveloperCloud_CMD_Tool>ic-create-password -u idA@cn.ibm.com -password password
 -w unlock -g ./keys/idA.ext

Executing action: CreatePassword ...
Password File created successfully!
Path : C:\DeveloperCloud_CMD_Tool\.\keys\idA.ext
File Name :idA.ext
Please do not edit this file!
The request has been submitted successfully.
Executing CreatePassword finished


Listing 2. Create protection file for idB
C:\DeveloperCloud_CMD_Tool>ic-create-password -u idB@cn.ibm.com -password password -w
 unlock  -g  ./keys/idB.ext

Executing action: CreatePassword  ...
Password File created successfully!
Path : C:\DeveloperCloud_CMD_Tool\.\keys\idB.ext
File Name :idB.ext
Please do not edit this file!
The request has been submitted successfully.
Executing CreatePassword  finished

If you run into any problem when executing this SmartCloud command, check the log under C:\DeveloperCloud_CMD_Tool\logs.


Task 2: Copy image from accountA

Currently, SmartCloud copies images into a persistent storage; such storage should have a non-attached status when copying the image. Let's create a fresh storage before issuing a copy-to command.

Step 1: Create a persistent storage to store copied image

You can create persistent storage either through the SmartCloud Enterprise user interface or the command line tool. These steps use the user interface.

Login to SmartCloud Enterprise with the ID idA@cn.ibm.com from the user interface and navigate to Control panel > Storage > Add storage. Figure 3 shows what to enter in the fields of the Add Storage window.


Figure 3. Add Storage window
SmartCloud Enterprise Add Storage window

Note, we're using the Linux® system to transfer images, so ext3 is selected. You have to evaluate the size of your transferred image in advance to help determine what size you should take at this step. Make sure the data center is the same one where your image is located.

As you can see in Figure 4, the newly created storage, storageA is in Non-Attached status which means you can use this storage to keep your copied image.


Figure 4. Created storage
Created storage

Step 2: Capture image and enable "copy allowed"

Let's assume you already captured an image (named "to_be_transferred_image") with idA@cn.ibm.com in RTP data center. By default, such a captured image is private and cannot be copied. To enable the image copy feature on a private image, you have to set copy allowed to Yes within the SmartCloud Enterprise asset management system. The following steps show you how.

  1. Click View asset catalog to view image information.

    Figure 5. View asset catalog
    View asset catalog

  2. Select your captured image and click the name.

    Figure 6. View image asset
    View image asset

  3. Click the edit icon shown in Figure 7.

    Figure 7. View image information
    View image information

  4. Click More on the Edit page as shown in Figure 8.

    Figure 8. Edit image information
    Edit image information

  5. Select Y for Copy Allowed and click the Update button.

    Figure 9. Set copy allowed to "yes"


Step 3: Test command line tool by describing captured image

Before you copy the image, test to see if the SmartCloud command line tool is running correctly when it connects to the SmartCloud service. In this step, run ic-describe-image to see if image information can be returned.

  1. Get the parameter values ready for the command. The important parameter is image id. You can get the image ID from the SmartCloud user interface as shown in Figure 10:

    Figure 10. Get image ID from the SmartCloud Enterprise Images tab
    Get image ID from the SmartCloud Enterprise Images tab

  2. Issue the describe command (Listing 3).

    Listing 3. The describe captured image command
    C:\DeveloperCloud_CMD_Tool>ic-describe-image -u idA@cn.ibm.com -w unlock -g
     ./keys/idA.ext -k 20043123
    

The command line tool should run with no exception thrown, and the image information should display after running the command.

Step 4: Run the copy-to command

To copy the image, you have to know the storage id of storageA. You can get the ID from the Storage tab in the SmartCloud Enterprise user interface.


Figure 11. Get the storage id of storageA
Get the storage id of storageA

Now you have both image id and storage id, it's time to run the copy-to command (Listing 4). Make sure the storageA status is Non-Attached before issuing the command.


Listing 4. Run the copy-to command
C:\DeveloperCloud_CMD_Tool>ic-copy-to -u idA@cn.ibm.com -w unlock -g
 ./keys/idA.ext -v 25893 -I 20043123
Executing action: CopyTo  ...
The request has been submitted successfully.
ID: 25893
Name: storageA
Owner: liuyank@cn.ibm.com
Size: 512 Gib
Format : ext3
State: COPYING
Location: 41
Storage Area Id:
Storage Area Name:
.....
Platform Version: 2
Executing CopyTo  finished

You can frequently run the ic-describe-image command to check the status (Listing 5). The copy-to command should be finished successfully if the state is listed as AVAILABLE; COPYING means it is still copying. For a 60GB image, it can take 40 minutes.


Listing 5. Describe image to check copying status
C:\DeveloperCloud_CMD_Tool>ic-describe-image -u idA@cn.ibm.com -w unlock -g
 ./keys/idA.ext -k 20043123
Executing action: DescribeImage ...
ID: 20043123
Name: to_be_transferred_image
Visibility: PRIVATE
State: COPYING
Owner: idA@cn.ibm.com
Platform: Red Hat Enterprise Linux/5.7
Location: 41

You can also check the status by issuing ic-describe-volume, which is used to describe storage.


Task 3: Transfer image files from accountA to accountB

To transfer images between different accounts, you have to set up two virtual machines.

Step 1: Create source instance: storage_server_accountA

This server acts as the copy source and the following operations in this step are against the RTP data center.

  1. Login with idA@cn.ibm.com, which is under accountA. Create a key named key_accountA. Download this key from SmartCloud Enterprise to a local machine.
  2. Create a RedHat 6 instance (storage_server_accountA) with persistent storage attached (created in Copy image from accountA) and key_accountA associated. Figures 12 and 13 provide the details.

    Figure 12. Create storage_server_accountA
    Create storage_server_accountA



    Figure 13. Attach storageA
    Attach storageA

  3. Note, set the mount point as /mnt when attaching the storage to storage_server_accountA. After the image copies, you can see there is a directory called image under /mnt. Check the /mnt directory after the storage instance is provisioned. Login to storage_server_accountA through an SSH tool such as xshell. Check files under /mnt to see if the image directory has been created by the copying command.

    Figure 14. Verify image directory is created
    Verify image directory is created

Step 2: Create target instance: storage_server_accountB

This server is to receive the transferred image and the following operations are against the Boulder data center in this step.

  1. Through the SmartCloud Enterprise user interface, login with idB@cn.ibm.com which is under accountB.
  2. Create a persistent storage named storage with the ext3 format and 512GB.

    Figure 15. Create storageB
    Create storageB

  3. Create a new key named key_accountB and download the key to a local machine.
  4. Create a RedHat 6 instance (storage_server_accountB) with storageB attached and key_accountB set.

    Figure 16. Create storage_server_accountB
    Create storage_server_accountB

  5. The mount point is /mnt when attaching storage into this instance.

    Figure 17. Attach storageB
    Attach storageB

Step 3: Copy image files from accountA to accountB

There are several ways (NFS, SFTP, SCP) to copy image files from accountA to accountB. This article provides two ways to transfer an image: SCP and NFS.

Transfer image files through SCP

  1. As idcuser, ssh to storage_server_accountA. In this example, xshell is used to do that.
  2. Issue vi to create a new key file for this purpose.

    Figure 18. Create new key file for SCP purpose
    Create new key file for SCP purpose

  3. Copy content from key_accountB (which was downloaded in the previous steps) to this new file. Note, you can open key_accountB with Windows note editor if you're running xshell from a Windows system, and then paste it into the vi new file.

    Figure 19. Content of the key_accountB
    Content of the key_accountB

  4. As idcuser, login to storage_server_accountB and check files under /mnt. As you can see, there is no image directory at this moment.

    Figure 20. Verify no image directory on storage_server_accountB
    Verify no image directory on storage_server_accountB

  5. As idcuser, login to storage_server_accountA, issue the scp command as root. This command will copy the image folder from storage_server_accountA to storage_server_accountB with key file of storage_server_accountB set.

Figure 21 depicts the detailed steps of copying image files from accountA(storage_server_accountA) to accountB(storage_server_accountB).


Figure 21. Execute SCP command to copy image files
Execute SCP command to copy image files

The 100% in Figure 22 indicates that the copy is completed.


Figure 22. Transfer is complete
Transfer is complete

Transfer image through NFS service

  1. As idcuser, login to storage_server_accountA.
  2. Set up the NFS service on storage_server_accountA. Add /mnt/image *(rw,no_root_squash) into /ext/exports when vi /etc/exports (Listing 6).

    Listing 6. Get the NFS service up
    [idcuser@vhost1335 ~]$ sudo bash
    [root@vhost1335 idcuser]# vi /etc/exports
    [root@vhost1335 idcuser]# /sbin/service iptables stop
    iptables: Flushing firewall rules:                              [  OK  ]
    iptables: Setting chains to policy ACCEPT: filter            [  OK  ]
    iptables: Unloading modules:                                     [  OK  ]
    [root@vhost1335 idcuser]# /sbin/service nfs start
    Starting NFS services:                                             [  OK  ]
    Starting NFS quotas:                                               [  OK  ]
    Starting NFS daemon:                                               [  OK  ]
    Starting NFS mountd:                                               [  OK  ]
    [root@vhost1335 idcuser]#
    

    Note, in this example, the firewall is stopped. To be safe, open the ports required by NFS services rather than stopping the firewall.
  3. As idcuser, login to storage_server_accountB, run the mount and copy commands on this server by running the commands shown in Listing 7. These commands move the image files from storage_server_accountA to storage_server_accountB.

    Listing 7. Mount image directory
    [idcuser@ vhost1208 ~]$ sudo bash
    [root@vhost1208 idcuser]# mkdir /mnt/tmp
    [root@vhost1208 idcuser]# mkdir /mnt/image
    [root@vhost1208 idcuser]# /sbin/service iptables stop
    iptables: Flushing firewall rules:                          [  OK  ]
    iptables: Setting chains to policy ACCEPT: filter        [  OK  ]
    iptables: Unloading modules:                                 [  OK  ]
    [root@vhost1208 idcuser]# mount -t nfs 170.224.165.60:/mnt/image  /mnt/tmp
    [root@vhost1208 idcuser]# cp  -r /mnt/tmp/* /mnt/image
    [root@vhost1208 idcuser]#umount /mnt/tmp
    

Verify image transfer is completed by listing /mnt/image on storage_server_accountB.


Figure 23. Verify image files are copied
Verify image files are copied

Task 4: Import image into accountB

Though you copied image files into storage_server_accountB, it's still not yet an image asset of accountB. To make it an image asset of accountB, you have to perform image import operations.

Step 1: Delete instance storage_server_accountB to detach persistent storage

The import image command only works well when the storage has been detached, so we have you to delete the storage_server_accountB to detach persistent storage. In this example, delete it using the SmartCloud Enterprise user interface.

Step 2: Import image with idB@cn.ibm.com which belongs to accountB

Before you import the image, you have to know the storage id of storageB, which is used to keep copied image files. Figure 24 shows you how to access the id of storageB.


Figure 24. Get storage id of storageB
Get storage id of storageB

You're ready to run the import command. You can get a new image id for the imported image at this step (Listing 8). This image id is uesd to check importing status later on storage_server_accountB. Also, here you provide a new name (transferred_image) for the imported image.


Listing 8. Execute image import command
C:\DeveloperCloud_CMD_Tool>ic-import-image -u idB@cn.ibm.com -w unlock -g
 ./keys/idB.ext -n "tranferred_image" -v 25970
Executing action: ImportImage  ...
The request has been submitted successfully.
Image ID: 20043226
Name: tranferred_image
Description: A generic bundle/subcomponent to price imported images that did not
 originate from SmartCloud
Location: 82
Owner: idB@cn.ibm.com
State: IMPORTING
Visibility: PRIVATE
....
Executing ImportImage  finished

Again, you can frequently run the describe command to check the status of importing. The import is finished successfully when the state is AVAILABLE; it is not finished if the state is IMPORTING. For a 60GB image, it can take about 30 minutes.


Listing 9. Check status of image importing
C:\DeveloperCloud_CMD_Tool>ic-describe-image -u idB@cn.ibm.com -w unlock -g
 ./keys/idB.ext -k 20043226
Executing action: DescribeImage  ...
ID: 20043226
Name: tranferred_image
Visibility: PRIVATE
State: IMPORTING
Owner: idB@cn.ibm.com
Platform:
Location: 82
Architecture:
Documentation:
Manifest:
Description: A generic bundle/subcomponent to price imported images that did not
 originate from SmartCloud
.......

You can also check status by logging in (as idB@cn.ibm.com) to the SmartCloud Enterprise user interface as shown in Figure 25.


Figure 25. Check status of image importing
Check status of image importing

Step 3: Verification on accountB

The direct way to verify the imported image is to provision a new instance based on the previous imported image.

Find the imported image from the user interface with accountB id (idB@cn.ibm.com), select it, and click Create instance.


Figure 26. Select imported image to provision
Select imported image to provision

Provision the instance as you usually do. After provisioning, check to see if you can login to a new instance then see if services on that instance can run well.


In conclusion

In this article, we've provided the detailed steps necessary to perform image transfer between accounts, even those accounts located at different IBM data centers. With this feature provided by IBM SmartCloud Enterprise 2.0, you have better choices to protect your assets. However, SmartCloud Enterprise only supports this type of image transfer one image at a time. Keep watching. As soon as we've developed an enhanced solution to transfer images in batch, we'll let you know.


Resources

Learn

Get products and technologies

Discuss

About the authors

Chun Feng Wu is an IBM Certified Solution Advisor and an IBM Certified Solution Architect for cloud computing. He worked on the IBM public cloud, SmartCloud Enterprise and now works on IBM managed cloud, SmartCloud Enterprise Plus.

Yi Shuai Wang is an Advisory Architect at IBM and lead developer for the development of the business support services of IBM SmartCloud Enterprise.

Guo Ning Liu is a staff software engineer with the IBM SmartCloud Enterprise development team, IBM China Development Lab. Since 2009 Liu Guo has been working with provisioning and managing images for IBM Smart Cloud Enterprise.

Alex Amies photo

Alex Amies is a senior software engineer in the IBM GTS Development Lab in the China development lab. He is currently an architect working on the design of the IBM SmartCloud Enterprise. Previously, he acted as an architect and a developer on cloud and security products in other groups within IBM.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Cloud computing, Java technology
ArticleID=819885
ArticleTitle=Create solutions on IBM SmartCloud Enterprise: Transfer image assets between different accounts
publish-date=06062012

Next steps from IBM

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers