Using VBoxManage Commands With <ph conkeyref="vbox-conkeyref-phrases/oci"/>

This section includes some examples of how VBoxManage commands can be used to integrate with and perform common cloud operations.

Creating a Cloud Profile

To create a cloud profile called vbox-oci:

VBoxManage cloudprofile --provider "OCI" --profile="vbox-oci" add \
--clouduser="ocid1.user.oc1..."  --keyfile="/home/username/.oci/oci_api_key.pem" \
--tenancy="ocid1.tenancy.oc1..."  --compartment="ocid1.compartment.oc1..."  --region="us-ashburn-1"

The new cloud profile is added to the oci_config file in your global configuration directory. For example, this is $HOME/.VirtualBox/oci_config on a Windows host.

Listing Cloud Instances

To list the instances in your compartment:

VBoxManage cloud --provider="OCI" --profile="vbox-oci" list instances

Exporting an VM to the Cloud

To export a VM called myVM and create a cloud instance called myVM_Cloud:

VBoxManage export myVM --output OCI:// --cloud 0 --vmname myVM_Cloud \
--cloudprofile "vbox-oci" --cloudbucket myBucket \
--cloudshape VM.Standard2.1 --clouddomain US-ASHBURN-AD-1 --clouddisksize 50  \
--cloudocivcn ocid1.vcn.oc1... --cloudocisubnet ocid1.subnet.oc1... \
--cloudkeepobject true --cloudlaunchinstance true --cloudpublicip true
      

Importing a Cloud Instance Into

To import a cloud instance and create an VM called oci_Import:

VBoxManage import OCI:// --cloud --vmname oci_Import --memory 4000
--cpus 3 --ostype FreeBSD_64 --cloudprofile "vbox-oci"
--cloudinstanceid ocid1.instance.oc1... --cloudbucket myBucket
  

Creating a New Cloud Instance From a Custom Image

To create a new cloud instance from a custom image on :

VBoxManage cloud --provider="OCI" --profile="vbox-oci" instance create \
--domain-name="oraclecloud.com" --image-id="ocid1.image.oc1..." --display-name="myInstance" \
--shape="VM.Standard2.1" --subnet="ocid1.subnet.oc1..."

Terminating a Cloud Instance

To terminate an instance in your compartment on :

VBoxManage cloud --provider="OCI" --profile="vbox-oci" instance terminate \
--id="ocid1.instance.oc1..." 

Showing Cloud Instance Performance Metrics

To show CPU usage metrics for a cloud instance:

VBoxManage cloud --provider="OCI" --profile="vbox-oci" instance metricdata \
--id="ocid1.instance.oc1..." --metric-name="CpuUtilization"

For more details about the available commands for cloud operations, see .