Skip to content

Commit

Permalink
OCTOPUS-519: update scripts for ibmcloud plugin poweriaas v1.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Bastide <[email protected]>
  • Loading branch information
prb112 committed Jan 30, 2024
1 parent 24ee6ae commit b6f9403
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ A: Yes, as part of the setup, you will import from the RHCOS bucket.
To import rhcos:

```
ibmcloud pi image-import rhcos-415-92-202312071243-t1
ibmcloud pi image import rhcos-415-92-202312071243-t1
--bucket-access public --storage-pool Tier1-Flash-1
--bucket rhcos-powervs-images-us-east --region us-east --job --json --os-type rhel
--image-file-name rhcos-415-92-202312071243-0-ppc64le-powervs.ova.gz
Expand All @@ -105,7 +105,7 @@ ibmcloud pi image-import rhcos-415-92-202312071243-t1
To import the Centos stock image:

```
ibmcloud pi image-create CentOS-Stream-8
ibmcloud pi image create CentOS-Stream-8
```

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion modules/0_vpc/reuse/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ locals {
region = "tor",
zone = "tor01"
},
ca-mon = {
ca-mon = {
region = "mon",
zone = "mon01"
},
Expand Down
3 changes: 0 additions & 3 deletions modules/5_image/files/upload_rhcos_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ fi
ibmcloud login --apikey "${API_KEY}" -r "${REGION}" -g "${RESOURCE_GROUP}"
ibmcloud plugin install -f cloud-internet-services vpc-infrastructure cloud-object-storage is

# Pin the version to 0.6.0 (v1.0.0 may be incompatible)
ibmcloud plugin install -v 0.6.0 -f power-iaas

# Download the RHCOS qcow2
TARGET_DIR=".openshift/image-local"
mkdir -p ${TARGET_DIR}
Expand Down
13 changes: 7 additions & 6 deletions scripts/create-pvs-workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [[ $(type -t ic) == function ]]
then
IBMCLOUD=ic
else
ibmcloud plugin install -v 0.6.0 -f power-iaas
ibmcloud plugin install -f power-iaas
fi

if [ -z "${WORKSPACE_NAME}" ]
Expand All @@ -31,8 +31,9 @@ then
return -1
fi

SERVICE_NAME=power-iaas
SERVICE_PLAN_NAME=power-virtual-server-group

${IBMCLOUD} resource service-instance-create "${WORKSPACE_NAME}" \
"${SERVICE_NAME}" "${SERVICE_PLAN_NAME}" "${REGION}" -g "${RESOURCE_GROUP}"
# Create the service instance
ibmcloud pi workspace create "${WORKSPACE_NAME}" \
--plan public \
--datacenter "${REGION}" \
--json \
--group "${RESOURCE_GROUP}" 2>&1
4 changes: 3 additions & 1 deletion scripts/create-var-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [[ $(type -t ic) == function ]]
then
IBMCLOUD=ic
else
${IBMCLOUD} plugin install -v 0.6.0 -f power-iaas
${IBMCLOUD} plugin install -f power-iaas
fi

if [ ! -z "${1}" ]
Expand Down Expand Up @@ -83,13 +83,15 @@ else
POWERVS_ZONE=$(${IBMCLOUD} resource service-instances --output json | jq -r '.[] | select(.guid == "'${POWERVS_SERVICE_INSTANCE_ID}'").region_id')
POWERVS_REGION=$(
case "$POWERVS_ZONE" in
("dal10") echo "dal" ;;
("dal12") echo "dal" ;;
("us-south") echo "us-south" ;;
("wdc06") echo "wdc" ;;
("us-east") echo "us-east" ;;
("sao01") echo "sao" ;;
("tor01") echo "tor" ;;
("mon01") echo "mon" ;;
("mad01") echo "mad" ;;
("eu-de-1") echo "eu-de" ;;
("eu-de-2") echo "eu-de" ;;
("lon04") echo "lon" ;;
Expand Down
8 changes: 4 additions & 4 deletions scripts/import-centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ else
then
IBMCLOUD=ic
else
ibmcloud plugin install -v 0.6.0 -f power-iaas
ibmcloud plugin install -f power-iaas
fi
fi

POWERVS_CRN=$(${IBMCLOUD} pi sl 2>&1 | grep "${SERVICE_INSTANCE_ID}" | awk '{print $1}')
${IBMCLOUD} pi st "${POWERVS_CRN}"
POWERVS_CRN=$(${IBMCLOUD} pi workspace ls 2>&1 | grep "${SERVICE_INSTANCE_ID}" | awk '{print $1}')
${IBMCLOUD} pi workspace target "${POWERVS_CRN}"

${IBMCLOUD} pi image-create CentOS-Stream-8
${IBMCLOUD} pi image create CentOS-Stream-8
echo "Finished importing CentOS-Stream-8"

0 comments on commit b6f9403

Please sign in to comment.