File: cloud-using-cli.dita

package info (click to toggle)
virtualbox 7.1.12-dfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: sid
  • size: 565,672 kB
  • sloc: ansic: 2,330,854; cpp: 2,193,228; asm: 230,777; python: 223,895; xml: 86,771; sh: 25,541; makefile: 8,158; perl: 5,697; java: 5,337; cs: 4,872; pascal: 1,782; javascript: 1,692; objc: 1,131; lex: 931; php: 906; sed: 899; yacc: 707
file content (60 lines) | stat: -rw-r--r-- 3,920 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?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>