-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from bkhadars/docs
Add Docs for Image upload and import commands
- Loading branch information
Showing
3 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Overview | ||
This guide talks about how to import image to PowerVs instance using pvsadm. | ||
|
||
# Prerequisite | ||
- pvsadm tool | ||
- IBMCLOUD_API_KEY. [How to create api key](https://cloud.ibm.com/docs/account?topic=account-userapikey#create_user_key) | ||
- S3 BucketName, Bucket Region, ObjectName | ||
- PowerVS Instance Name/PowerVS Instance ID. | ||
|
||
# Image import Command help | ||
```shell | ||
$pvsadm image import --help | ||
Flags: | ||
--accesskey string Cloud Storage access key | ||
-b, --bucket string Cloud Storage bucket name | ||
-h, --help help for import | ||
--image-name string Name to give imported image | ||
-i, --instance-id string Instance ID of the PowerVS instance | ||
-n, --instance-name string Instance name of the PowerVS | ||
-o, --object-name string Cloud Storage image filename | ||
--ostype string Image OS Type, accepted values are[aix, ibmi, redhat, sles] (default "redhat") | ||
-r, --region string COS bucket location | ||
--secretkey string Cloud Storage secret key | ||
--service-credential-name string Service Credential name to be auto generated (default "pvsadm-service-cred") | ||
--storagetype string Storage type, accepted values are [tier1, tier3] (default "tier3") | ||
``` | ||
|
||
# Importing Image to PowerVS instance from S3 Bucket using pvsadm | ||
|
||
Set the API key variable | ||
```shell | ||
$export IBMCLOUD_API_KEY=<IBM_CLOUD_API_KEY> | ||
``` | ||
|
||
### case 1: | ||
Importing the image using auto-generated s3 credential | ||
```shell | ||
$pvsadm image import -n <POWERVS_INSTANCE_NAME> -b <BUCKETNAME> --object rhel-83-10032020.ova.gz --pvs-image-name test-image -r <REGION> | ||
``` | ||
|
||
### case 2: | ||
Importing the image using accesskey and secretkey | ||
```shell | ||
$pvsadm image import -n <POWERVS_INSTANCE_NAME> -b <BUCKETNAME> --accesskey <ACCESSKEY> --secretkey <SECRETKEY> --object rhel-83-10032020.ova.gz --pvs-image-name test-image -r <REGION> | ||
``` | ||
|
||
### case 3: | ||
If user wants to specify the PowerVS storage type for importing the image | ||
```shell | ||
$pvsadm image import -n <POWERVS_INSTANCE_NAME> -b <BUCKETNAME> --object rhel-83-10032020.ova.gz --pvs-image-name test-image -r <REGION> --storagetype <POWERVS_STORAGE_TYPE> | ||
``` | ||
|
||
### case 4: | ||
If user wants to specify type of OS | ||
```shell | ||
$pvsadm image import -n <POWERVS_INSTANCE_NAME> -b <BUCKETNAME> --object rhel-83-10032020.ova.gz --pvs-image-name test-image -r <REGION> --ostype <OSTYPE> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Overview | ||
This guide talks about how to upload image file to Cloud object Storage instance using pvsadm. | ||
|
||
# Prerequisite | ||
- pvsadm tool | ||
- Image file(RHEL/CENTOS/CoreOS) | ||
- IBMCLOUD_API_KEY. [How to create api key](https://cloud.ibm.com/docs/account?topic=account-userapikey#create_user_key) | ||
|
||
# Image upload command help: | ||
```shell | ||
$pvsadm image upload --help | ||
Usage: | ||
pvsadm image upload [flags] | ||
|
||
Flags: | ||
--resource-group string Name of user resource group. (default "default") | ||
--cos-storageclass string Cloud Object Storage Class type, available values are [standard, smart, cold, vault]. (default "standard") | ||
-n, --cos-instance-name string Cloud Object Storage instance name. | ||
-b, --bucket string Cloud Object Storage bucket name. | ||
-f, --file string The PATH to the file to upload. | ||
-r, --bucket-region string Cloud Object Storage bucket region. (default "us-south") | ||
-h, --help help for upload | ||
``` | ||
|
||
# Image upload using pvsadm tool | ||
|
||
Mandatory parameters for uploading the object to Cloud object storage using pvsadm tool are --bucket and --file | ||
|
||
### case 1: | ||
If user wants to upload the object to the bucket in the default region(us-south). | ||
```shell | ||
$pvsadm image upload --bucket bucket0711 -f rhcos-461.ova.gz | ||
``` | ||
|
||
### case 2: | ||
If bucket doesn't exists in default region(us-south), then user has to provide --bucket-region parameter to pvsadm tool. | ||
```shell | ||
$pvsadm image upload --bucket bucket0711 -f rhcos-461.ova.gz --bucket-region <REGION> | ||
``` | ||
|
||
### case 3: | ||
If user knows Cloud Object Storage Instance where bucket is created, then use --cos-instance-name | ||
```shell | ||
$pvsadm image upload --bucket bucket0711 -f rhcos-461.ova.gz --cos-instance-name pvsadm-cos-instance --bucket-region <REGION> | ||
``` | ||
|
||
### case 4: | ||
If user is planning to create a new Cloud Object Storage Instance(S3 service) | ||
```shell | ||
$pvsadm image upload --bucket bucket1320 -f centos-8-latest.ova.gz --resource-group <ResourceGroup_Name> --bucket-region <REGION> | ||
``` |