21 lines
863 B
Bash
Executable File
21 lines
863 B
Bash
Executable File
#!/bin/bash
|
|
# Script to terminate ch2 instance directly via OCI CLI and then reallocate resources
|
|
|
|
echo "=== Terminating ch2 instance directly via OCI CLI ==="
|
|
|
|
# Terminate ch2 instance
|
|
echo "Terminating ch2 instance: ocid1.instance.oc1.ap-chuncheon-1.an4w4ljr3uhxzjacsw3vito3k7xl2fluuuh7umrq2bqhd633ezovacs6ms7a"
|
|
oci --profile korea compute instance terminate --instance-id ocid1.instance.oc1.ap-chuncheon-1.an4w4ljr3uhxzjacsw3vito3k7xl2fluuuh7umrq2bqhd633ezovacs6ms7a --force
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo "Successfully terminated ch2 instance"
|
|
else
|
|
echo "Failed to terminate ch2 instance"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Waiting for instance termination to complete..."
|
|
sleep 60
|
|
|
|
echo "Ch2 instance terminated successfully. Now you can allocate the resources to A1 instance."
|
|
echo "You can now run Terraform to create the new storage configuration for A1 instance." |