• Image Management Service

ims
  1. Help Center
  2. Image Management Service
  3. User Guide
  4. Managing Private Images
  5. Quickly Importing an Image File
  6. Using s3cmd to Upload a Bitmap File

Using s3cmd to Upload a Bitmap File

  1. Install s3cmd.

    If the tool has been installed, skip this step go to the next step.

    1. Run the following command to install Setuptools:

      yum install python-setuptools

    2. Run the following command to install Wget:

      yum install wget

    3. Run the following commands to obtain the s75pxd software package:

      wget https://github.com/s3tools/s3cmd/archive/master.zip

      mv master.zip s3cmd-master.zip

    4. Run the following commands to install s3cmd:

      unzip s3cmd-master.zip

      cd s3cmd-master

      python setup.py install

  2. Configure s3cmd.

    Run the following command to configure s3cmd:

    s3cmd --configure
    Access Key: Enter the AK.
    Secret Key: Enter the SK.
    Default Region: indicates the region where the bucket is located.
    S3 Endpoint: Refer to the OBS endpoint.
    DNS-style bucket+hostname:port template for accessing a bucket: indicates the server address with the bucket name, for example, %(bucket)s.obs.myclouds.com.
    Encryption password: Press Enter.
    Path to GPG program: Press Enter.
    Use HTTPS protocol: specifies whether to use HTTPS. The value can be Yes or No.)
    HTTP Proxy server name: indicates the proxy address to connect the cloud from an external network. (If you do not need connect to the cloud, press Enter.)
    HTTP Proxy server port: indicates the proxy port to connect to the cloud from an external network (If you do not need connect to the cloud, press Enter.)
    Test access with supplied credentials? y
    (If Success. Your access key and secret key worked fine :-) is displayed, the connection is successful.)
    Save settings? y (Specifies whether to save the configuration. If y is entered, the configuration will be saved.)
    NOTE:

    The configuration is saved in the /root/.s3cfg directory. If you want to modify the configuration, run the s3cmd --configure command again or directly edit the .s3cfg file by running the vi .s3cfg command.

  3. Run the following command to upload image.qcow2 to the bucket named mybucket:

    s3cmd put image.qcow2 s3://mybucket/