60 lines
3.8 KiB
XML
60 lines
3.8 KiB
XML
<?xml version='1.0' encoding='UTF-8'?>
|
|
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
|
|
<topic xml:lang="en-us" id="cloud-using-cli">
|
|
<title>Using VBoxManage Commands With <ph conkeyref="vbox-conkeyref-phrases/oci"/></title>
|
|
|
|
<body>
|
|
<p>This section includes some examples of how <userinput>VBoxManage</userinput> commands can be used to integrate
|
|
with <ph conkeyref="vbox-conkeyref-phrases/oci"/> and perform common cloud operations. </p>
|
|
<p><b outputclass="bold">Creating a Cloud Profile</b>
|
|
</p>
|
|
<p>To create a cloud profile called <codeph>vbox-oci</codeph> for <ph conkeyref="vbox-conkeyref-phrases/oci"/> as the cloud provider: </p>
|
|
<pre xml:space="preserve">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"
|
|
</pre>
|
|
<p>The new cloud profile is added to the <filepath>oci_config</filepath> file in your <ph
|
|
conkeyref="vbox-conkeyref-phrases/product-name"/> global configuration directory. For example, this is
|
|
<filepath>$HOME/.VirtualBox/oci_config</filepath> on a Windows host. </p>
|
|
<p><b outputclass="bold">Listing Cloud Instances</b>
|
|
</p>
|
|
<p>To list the instances in your <ph conkeyref="vbox-conkeyref-phrases/oci"/> compartment: </p>
|
|
<pre xml:space="preserve">VBoxManage cloud --provider="OCI" --profile="vbox-oci" list instances
|
|
</pre>
|
|
<p><b outputclass="bold">Exporting an <ph conkeyref="vbox-conkeyref-phrases/product-name"/> VM to the Cloud</b>
|
|
</p>
|
|
<p>To export a VM called <codeph>myVM</codeph> and create a cloud instance called <codeph>myVM_Cloud</codeph>: </p>
|
|
<pre xml:space="preserve">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
|
|
</pre>
|
|
<p><b outputclass="bold">Importing a Cloud Instance Into <ph conkeyref="vbox-conkeyref-phrases/product-name"/></b>
|
|
</p>
|
|
<p>To import a cloud instance and create an <ph conkeyref="vbox-conkeyref-phrases/product-name"/> VM called
|
|
<codeph>oci_Import</codeph>: </p>
|
|
<pre xml:space="preserve">VBoxManage import OCI:// --cloud --vmname oci_Import --memory 4000
|
|
--cpus 3 --ostype FreeBSD_64 --cloudprofile "vbox-oci"
|
|
--cloudinstanceid ocid1.instance.oc1... --cloudbucket myBucket
|
|
</pre>
|
|
<p><b outputclass="bold">Creating a New Cloud Instance From a Custom Image</b>
|
|
</p>
|
|
<p>To create a new cloud instance from a custom image on <ph conkeyref="vbox-conkeyref-phrases/oci"/>: </p>
|
|
<pre xml:space="preserve">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..."</pre>
|
|
<p><b outputclass="bold">Terminating a Cloud Instance</b>
|
|
</p>
|
|
<p>To terminate an instance in your compartment on <ph conkeyref="vbox-conkeyref-phrases/oci"/>: </p>
|
|
<pre xml:space="preserve">VBoxManage cloud --provider="OCI" --profile="vbox-oci" instance terminate \
|
|
--id="ocid1.instance.oc1..." </pre>
|
|
|
|
<p><b outputclass="bold">Showing Cloud Instance Performance Metrics</b></p>
|
|
<p>To show CPU usage metrics for a cloud instance: </p>
|
|
<pre xml:space="preserve">VBoxManage cloud --provider="OCI" --profile="vbox-oci" instance metricdata \
|
|
--id="ocid1.instance.oc1..." --metric-name="CpuUtilization"</pre>
|
|
<p>For more details about the available commands for cloud operations, see <xref href="vboxmanage-cloud.dita"/>. </p>
|
|
</body>
|
|
|
|
</topic>
|