1 | <?xml version='1.0' encoding='UTF-8'?>
|
---|
2 | <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
|
---|
3 | <topic xml:lang="en-us" id="cloud-using-cli">
|
---|
4 | <title>Using VBoxManage Commands With <ph conkeyref="vbox-conkeyref-phrases/oci"/></title>
|
---|
5 |
|
---|
6 | <body>
|
---|
7 | <p>This section includes some examples of how <userinput>VBoxManage</userinput> commands can be used to integrate
|
---|
8 | with <ph conkeyref="vbox-conkeyref-phrases/oci"/> and perform common cloud operations. </p>
|
---|
9 | <p><b outputclass="bold">Creating a Cloud Profile</b>
|
---|
10 | </p>
|
---|
11 | <p>To create a cloud profile called <codeph>vbox-oci</codeph> for <ph conkeyref="vbox-conkeyref-phrases/oci"/> as the cloud provider: </p>
|
---|
12 | <pre xml:space="preserve">VBoxManage cloudprofile --provider "OCI" --profile="vbox-oci" add \
|
---|
13 | --clouduser="ocid1.user.oc1..." --keyfile="/home/username/.oci/oci_api_key.pem" \
|
---|
14 | --tenancy="ocid1.tenancy.oc1..." --compartment="ocid1.compartment.oc1..." --region="us-ashburn-1"
|
---|
15 | </pre>
|
---|
16 | <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>
|
---|
17 | <p><b outputclass="bold">Listing Cloud Instances</b>
|
---|
18 | </p>
|
---|
19 | <p>To list the instances in your <ph conkeyref="vbox-conkeyref-phrases/oci"/> compartment: </p>
|
---|
20 | <pre xml:space="preserve">VBoxManage cloud --provider="OCI" --profile="vbox-oci" list instances
|
---|
21 | </pre>
|
---|
22 | <p><b outputclass="bold">Exporting an <ph conkeyref="vbox-conkeyref-phrases/product-name"/> VM to the Cloud</b>
|
---|
23 | </p>
|
---|
24 | <p>To export a VM called <codeph>myVM</codeph> and create a cloud instance called <codeph>myVM_Cloud</codeph>: </p>
|
---|
25 | <pre xml:space="preserve">VBoxManage export myVM --output OCI:// --cloud 0 --vmname myVM_Cloud \
|
---|
26 | --cloudprofile "vbox-oci" --cloudbucket myBucket \
|
---|
27 | --cloudshape VM.Standard2.1 --clouddomain US-ASHBURN-AD-1 --clouddisksize 50 \
|
---|
28 | --cloudocivcn ocid1.vcn.oc1... --cloudocisubnet ocid1.subnet.oc1... \
|
---|
29 | --cloudkeepobject true --cloudlaunchinstance true --cloudpublicip true
|
---|
30 | </pre>
|
---|
31 | <p><b outputclass="bold">Importing a Cloud Instance Into <ph conkeyref="vbox-conkeyref-phrases/product-name"/></b>
|
---|
32 | </p>
|
---|
33 | <p>To import a cloud instance and create an <ph conkeyref="vbox-conkeyref-phrases/product-name"/> VM called
|
---|
34 | <codeph>oci_Import</codeph>: </p>
|
---|
35 | <pre xml:space="preserve">VBoxManage import OCI:// --cloud --vmname oci_Import --memory 4000
|
---|
36 | --cpus 3 --ostype FreeBSD_64 --cloudprofile "vbox-oci"
|
---|
37 | --cloudinstanceid ocid1.instance.oc1... --cloudbucket myBucket
|
---|
38 | </pre>
|
---|
39 | <p><b outputclass="bold">Creating a New Cloud Instance From a Custom Image</b>
|
---|
40 | </p>
|
---|
41 | <p>To create a new cloud instance from a custom image on <ph conkeyref="vbox-conkeyref-phrases/oci"/>: </p>
|
---|
42 | <pre xml:space="preserve">VBoxManage cloud --provider="OCI" --profile="vbox-oci" instance create \
|
---|
43 | --domain-name="oraclecloud.com" --image-id="ocid1.image.oc1..." --display-name="myInstance" \
|
---|
44 | --shape="VM.Standard2.1" --subnet="ocid1.subnet.oc1..."</pre>
|
---|
45 | <p><b outputclass="bold">Terminating a Cloud Instance</b>
|
---|
46 | </p>
|
---|
47 | <p>To terminate an instance in your compartment on <ph conkeyref="vbox-conkeyref-phrases/oci"/>: </p>
|
---|
48 | <pre xml:space="preserve">VBoxManage cloud --provider="OCI" --profile="vbox-oci" instance terminate \
|
---|
49 | --id="ocid1.instance.oc1..." </pre>
|
---|
50 |
|
---|
51 | <p><b outputclass="bold">Showing Cloud Instance Performance Metrics</b></p>
|
---|
52 | <p>To show CPU usage metrics for a cloud instance: </p>
|
---|
53 | <pre xml:space="preserve">VBoxManage cloud --provider="OCI" --profile="vbox-oci" instance metricdata \
|
---|
54 | --id="ocid1.instance.oc1..." --metric-name="CpuUtilization"</pre>
|
---|
55 | <p>For more details about the available commands for cloud operations, see <xref href="../cli_topics/vboxmanage-cloud.dita"/>.</p>
|
---|
56 | </body>
|
---|
57 |
|
---|
58 | </topic>
|
---|