6 Integrating with Oracle Cloud Infrastructure
Oracle VirtualBox can integrate with Oracle Cloud Infrastructure. For example you can create cloud VMs, or import Compute instances to Oracle VirtualBox.
Using Oracle VirtualBox With Oracle Cloud Infrastructure describes how you can use Oracle VirtualBox with Oracle Cloud Infrastructure.
Before using Oracle VirtualBox with Oracle Cloud Infrastructure there are some initial configuration steps you may need to do. See Preparing for Oracle Cloud Infrastructure Integration.
Preparing for Oracle Cloud Infrastructure Integration
Perform the following configuration steps before using Oracle VirtualBox to integrate with your Oracle Cloud Infrastructure account.
-
Install the Extension Pack. Cloud integration features are only available when you install the Oracle VirtualBox Extension Pack. See Install the Oracle VirtualBox Extension Pack.
-
Create a key pair. Generate an API signing key pair that is used for API requests to Oracle Cloud Infrastructure. See Creating an API Signing Key Pair.
Upload the public key of the key pair from your client device to the cloud service. See Uploading the Public Key to Oracle Cloud Infrastructure.
-
Create a cloud profile. The cloud profile contains resource identifiers for your cloud account, such as your user OCID, and details of your key pair. See Creating a Cloud Profile.
Creating an API Signing Key Pair
To use the cloud integration features of Oracle VirtualBox, you must generate an API signing key pair that is used for API requests to Oracle Cloud Infrastructure.
Your API requests are signed with your private key, and Oracle Cloud Infrastructure uses the public key to verify the authenticity of the request. You must upload the public key to the Oracle Cloud Infrastructure Console.
Note:
This key pair is not the same SSH key that you use to access compute instances on Oracle Cloud Infrastructure.
-
(Optional) Create a
.oci
directory to store the key pair.$ mkdir ~/.oci
The key pair is usually installed in the
.oci
folder in your home directory. For example,~/.oci
on a Linux system. -
Generate the private key.
Use the
openssl
command.-
To generate a private key with a passphrase (prompt for passphrase):
$ openssl genrsa -out ~/.oci/oci_api_key.pem -aes256 2048
-
To generate a private key with a passphrase entered on the command line as an argument:
$ openssl genrsa -aes256 -passout pass:user_passphrase -out ~/.oci/oci_api_key.pem 2048
-
To generate a private key without a passphrase:
$ openssl genrsa -out ~/.oci/oci_api_key.pem 2048
-
-
Change permissions for the private key.
$ chmod 600 ~/.oci/oci_api_key.pem
Generate the public key.
$ openssl rsa -pubout -in ~/.oci/oci_api_key.pem -out ~/.oci/oci_api_key_public.pem
Enter the passphrase when prompted, if you set one.
Uploading the Public Key to Oracle Cloud Infrastructure
Use the following steps to upload your public key to Oracle Cloud Infrastructure.
-
Log in to the Oracle Cloud Console.
-
Click Profile, User settings.
-
Display your current API signing keys.
Click Resources, API Keys.
-
Upload the public key.
Click Add Public Key.
The Add Public Key dialog is displayed.
-
Select one of the following options:
-
Choose Public Key File. This option enables you to browse to the public key file on your local hard disk.
-
Paste Public Keys. This option enables you to paste the contents of the public key file into the window in the dialog box.
-
-
Click Add to upload the public key.
Creating a Cloud Profile
Oracle VirtualBox uses a cloud profile to connect to Oracle Cloud Infrastructure. A cloud profile is a text file that contains details of your key files and Oracle Cloud Identifier (OCID) resource identifiers for your cloud account, such as the following:
-
Fingerprint of the public key. To obtain the fingerprint, you can use the openssl command:
$ openssl rsa -pubout -outform DER -in ~/.oci/oci_api_key.pem | openssl md5 -c
-
Location of the private key on the client device. Specify the full path to the private key.
-
(Optional) Passphrase for the private key. This is only required if the key is encrypted.
-
Region. Shown on the Oracle Cloud Infrastructure Console. Click Administration, Tenancy Details.
-
Tenancy OCID. Shown on the Oracle Cloud Infrastructure Console. Click Administration, Tenancy Details.
A link enables you to copy the Tenancy OCID.
-
Compartment OCID. Shown on the Oracle Cloud Infrastructure Console. Click Identity, Compartments.
A link enables you to copy the Compartment OCID.
-
User OCID. Shown on the Oracle Cloud Infrastructure Console. Click Profile, User Settings.
A link enables you to copy the User OCID.
You can create a cloud profile in the following ways:
-
Automatically, by using the Cloud Profile Manager. See Using the Cloud Profile Manager.
The Cloud Profile Manager is a Oracle VirtualBox Manager tool that enables you to create, edit, and manage cloud profiles for your cloud service accounts.
-
Automatically, by using the VBoxManage cloudprofile command. See VBoxManage cloudprofile.
-
Manually, by creating an
oci_config
file in your Oracle VirtualBox global configuration directory. For example, this is$HOME/.config/VirtualBox/oci_config
on a Linux host. -
Manually, by creating a
config
file in your Oracle Cloud Infrastructure configuration directory. For example, this is$HOME/.oci/config
on a Linux host.This is the same file that is used by the Oracle Cloud Infrastructure command line interface.
Oracle VirtualBox automatically uses the
config
file if no cloud profile file is present in your global configuration directory. Alternatively, you can import this file manually into the Cloud Profile Manager.
Using the Cloud Profile Manager
To open the Cloud Profile Manager click Cloud in Oracle VirtualBox Manager.
You can use the Cloud Profile Manager in the following ways:
-
To create a new cloud profile automatically.
-
To create a cloud profile by importing settings from your Oracle Cloud Infrastructure configuration file.
Creating a New Cloud Profile
-
Click Add and specify a Name for the profile.
-
Select the new profile, and then click Properties. Specify the following property values for the profile:
-
Compartment OCID
-
Fingerprint of the public key
-
Location of the private key on the client device
-
Region OCID
-
Tenancy OCID
-
User OCID
Some of these are settings for your Oracle Cloud Infrastructure account, which you can view from the Oracle Cloud Console.
-
-
(Optional) If you are using the cloud profile to connect to cloud virtual machines, select the Show VMs check box.
This creates a new subgroup of the OCI group in Oracle VirtualBox Manager. See About the OCI VM Group.
-
Click Apply to save your changes.
The cloud profile settings are saved to the
oci_config
file in your Oracle VirtualBox global settings directory.
You can also use VBoxManage cloudprofile
to create a cloud profile. See Using VBoxManage Commands With Oracle Cloud Infrastructure.
Importing a Cloud Profile
Follow these steps to import an existing Oracle Cloud Infrastructure configuration file into the Cloud Profile Manager:
-
Ensure that a
config
file is present in your Oracle Cloud Infrastructure configuration directory. For example, this is$HOME/.oci/config
on a Linux host. -
Click the Import icon to open a dialog that prompts you to import cloud profiles from external files.
Note:
This action overwrites any cloud profiles that are in your Oracle VirtualBox global settings directory.
-
Click Import.
Your cloud profile settings are saved to the
oci_config
file in your Oracle VirtualBox global settings directory. -
Click Properties to show the cloud profile settings.
Double-click the appropriate field to change the value.
-
Click Apply to save your changes.
Using Oracle VirtualBox With Oracle Cloud Infrastructure
This section describes how you can use Oracle VirtualBox with Oracle Cloud Infrastructure to do the following tasks:
-
Create, add, and manage Oracle Cloud Infrastructure cloud instances using Oracle VirtualBox Manager. See Using Cloud Virtual Machines.
-
Export an Oracle VirtualBox VM to Oracle Cloud Infrastructure. See Exporting an Appliance to Oracle Cloud Infrastructure.
-
Import a cloud instance into Oracle VirtualBox. See Importing an Instance from Oracle Cloud Infrastructure.
-
Connect from a local VM to an Oracle Cloud Infrastructure cloud subnet. See Using a Cloud Network.
-
Use the VBoxManage commands to integrate with Oracle Cloud Infrastructure and perform cloud operations. See Using VBoxManage Commands With Oracle Cloud Infrastructure.
Using Cloud Virtual Machines
A cloud virtual machine (cloud VM) is a type of VM that represents an instance on a cloud service. Cloud VMs are shown in the Machines list in Oracle VirtualBox Manager, in the same way as local VMs are.
By using cloud VMs you can create, manage, and control your Oracle Cloud Infrastructure instances from Oracle VirtualBox Manager.
Note:
Cloud VMs do not install, export, or import instances to the Oracle VirtualBox host. All operations are done remotely on the cloud service.
Cloud VMs can be used to do the following tasks in Oracle Cloud Infrastructure:
-
Create a new Oracle Cloud Infrastructure instance. See Creating a New Cloud VM.
-
Use an existing Oracle Cloud Infrastructure instance. See Adding a Cloud VM.
-
Copy an existing Oracle Cloud Infrastructure instance. See Cloning a Cloud VM.
-
Configure an Oracle Cloud Infrastructure instance. You can change settings for the instance, such as display name. See Changing Settings for a Cloud VM.
-
Control an Oracle Cloud Infrastructure instance. Stop, start, and terminate the instance. See Controlling a Cloud VM.
-
Create a console connection to an Oracle Cloud Infrastructure instance. See Creating an Instance Console Connection for a Cloud VM.
About the OCI VM Group
All cloud VMs are shown in the Machines list in Oracle VirtualBox Manager, in a special VM group called OCI.
Cloud VMs are further grouped according to the cloud profile used to connect to them. The cloud profile identifies the user and compartment for the cloud VM and includes details of the key pair used to connect to cloud instances. See Creating a Cloud Profile.
All cloud profiles registered with Oracle VirtualBox are listed automatically in the OCI group.
To enable or disable listing of cloud VMs in Oracle VirtualBox Manager for a specific cloud profile, follow these steps.
- Display the Cloud Profile Manager.
- Select or clear the List VMs check box for each cloud profile.
Creating a New Cloud VM
When you create a new cloud VM, a new Oracle Cloud Infrastructure instance is created and associated with the cloud VM.
Perform the following steps to create a new cloud VM:
-
Click a cloud profile in the OCI group.
The cloud VMs for the selected cloud profile are displayed.
-
Select Group, New Machine.
-
Configure the following settings for the new cloud VM:
-
Location: The cloud service provider that will host the new instance. Select Oracle Cloud Infrastructure.
-
Profile: The cloud profile used to connect to the new instance. Select from the available cloud profiles.
-
Source: The image that the new instance is based on. Choose from the available images and boot volumes.
-
-
Change the Cloud Virtual Machine Settings as required. You will likely need to change the display name, shape, and networking configuration.
To add an SSH key to the instance, click the SSH Authorised Keys field and paste the public key into the displayed dialog.
-
Click Finish to create a new Oracle Cloud Infrastructure instance using the selected image or boot volume. The new instance is started automatically.
The new cloud VM is shown in the OCI group in Oracle VirtualBox Manager.
Adding a Cloud VM
When you add a cloud VM, an existing Oracle Cloud Infrastructure instance is associated with the cloud VM. You can only add one cloud VM for each instance.
Perform the following steps to add a cloud VM:
-
Click a cloud profile in the OCI group.
The cloud VMs for the selected cloud profile are displayed.
-
Select Group, Add Machine.
-
Configure the following settings:
-
Source: The cloud service provider that hosts the instance used for the cloud VM. Select Oracle Cloud Infrastructure.
-
Profile: The cloud profile used to connect to the running instance. Select from the available cloud profiles.
-
Instances: The instance to use for the cloud VM. Choose from the available instances on your cloud service.
-
-
Click Finish to add a cloud VM based on the selected instance.
A cloud VM with the same name as the instance is added to the OCI group in Oracle VirtualBox Manager.
-
(Optional) To change the display name for the instance, click Settings and edit the Display Name field.
The cloud VM name in Oracle VirtualBox Manager is updated automatically.
Cloning a Cloud VM
When you clone a cloud VM, a copy of the Oracle Cloud Infrastructure instance for the cloud VM is created and associated with the new cloud VM.
Perform the following steps to clone a cloud VM:
-
Click a cloud profile in the OCI group.
The cloud VMs for the selected cloud profile are displayed.
-
Right-click the cloud VM you want to clone and select Clone.
The Clone Name dialog is displayed.
Enter a name for the clone.
The name you enter is also used as the display name for the related Oracle Cloud Infrastructure instance. The default name for the clone consists of the
_clone
suffix appended to the original name. For example,ol9-dev_clone
. -
Click OK to create the clone and the related Oracle Cloud Infrastructure instance. The new instance is started automatically.
The new cloud VM is shown in the OCI group in Machines in Oracle VirtualBox Manager.
Changing Settings for a Cloud VM
Select the cloud VM in Oracle VirtualBox Manager and click Settings.
-
For a new cloud VM, you can change many settings for the Oracle Cloud Infrastructure instance, such as the display name, shape, and disk size.
-
When you add a cloud VM based on an existing Oracle Cloud Infrastructure instance you can only change the display name.
Controlling a Cloud VM
You can use Oracle VirtualBox Manager to control a cloud VM as follows:
-
Start. Use the Start button in the Machines toolbar.
-
Stop. Click the cloud VM name and select Machine, Stop. Menu options to shut down and power off the cloud VM are available.
-
Reset. Click the cloud VM name and select Machine, Reset. The cloud VM is stopped, then restarted automatically.
-
Terminate. Use the Terminate button in the Oracle VirtualBox Manager toolbar.
Caution:
This action deletes the instance from Oracle Cloud Infrastructure.
When you control a cloud VM in Oracle VirtualBox Manager the machine list is updated automatically with the current instance state, such as Stopped or Running.
When you control an instance using the Oracle Cloud Infrastructure console, Oracle VirtualBox Manager updates the status for the corresponding cloud VM automatically.
Monitoring Cloud VM Performance
You can monitor the performance of cloud VM instances in the following ways:
-
Use the virtual machine monitoring tools in Oracle VirtualBox Manager.
-
To show detailed performance data for a cloud VM:
Click the cloud VM name in the Machines list and click Resource Use.
Several time series charts are displayed, showing resource usage and performance data. To save the data to file, click Export.
-
To show a performance summary for all cloud VMs:
Click Resources to see a summary of performance metrics for all running cloud VMs and for the host system.
See also Monitoring of Virtual Machines.
-
-
Use the
VBoxManage cloud instance
command, as follows:-
VBoxManage cloud instance metriclist
shows the available metrics for an instance. -
VBoxManage cloud instance metricdata
shows metrics data for an instance.
See also VBoxManage cloud.
-
Note:
To monitor a cloud VM, the Compute Instance Monitoring plugin must be enabled and running on the Oracle Cloud Infrastructure instance. See the Oracle Cloud Infrastructure documentation for more details.
Removing a Cloud VM
You can use Oracle VirtualBox Manager to remove a cloud VM as follows:
Right-click the cloud VM name and select Remove.
-
Click Remove Only to remove the cloud VM from the Machines list in VirtualBox Manager.
-
Click Delete Everything to remove the cloud VM from Oracle VirtualBox Manager and also to delete the Oracle Cloud Infrastructure instance and any associated boot volumes.
Creating an Instance Console Connection for a Cloud VM
To create a instance console connection, the cloud VM must be in Running state.
- Right-click the cloud VM name and select Console, Create Connection.
-
The Public Key dialog is displayed. Paste the public key used for the instance connection into the dialog and click OK.
By default, either the first entry in your SSH keys folder or the public key used for your previous instance console connection is used.
-
Click Connect to connect to the instance. An instance console is displayed automatically on the host.
-
(Optional) Click Show Log to display log messages for the instance console connection.
See the Oracle Cloud Infrastructure documentation for details about how you can use an instance console connection to troubleshoot instance problems.
Exporting an Appliance to Oracle Cloud Infrastructure
Oracle VirtualBox supports the export of VMs to an Oracle Cloud Infrastructure service. The exported VM is stored on Oracle Cloud Infrastructure as a custom Linux image. You can configure whether a cloud instance is created and started after the export process has completed.
Note:
Before you export a VM to Oracle Cloud Infrastructure, you must prepare the VM as described in Preparing a VM for Export to Oracle Cloud Infrastructure.
Use the following steps to export a VM to Oracle Cloud Infrastructure:
-
Select File, Export Appliance.
-
Select a VM to export, and then click Next to display the Format Settings page.
-
From the Format drop-down list, select Oracle Cloud Infrastructure.
-
In the Profile drop-down list, select the cloud profile used for your Oracle Cloud Infrastructure account.
-
In the Machine Creation field, select an option to configure settings for the cloud instance created when you export to Oracle Cloud Infrastructure. The options enable you to do one of the following:
-
Configure settings for the cloud instance after you have finished exporting the VM.
-
Configure settings for the cloud instance before you start to export the VM.
-
Do not create a cloud instance when you export the VM.
Click Next to make an API request to the Oracle Cloud Infrastructure service and open the Appliance Settings page.
-
-
(Optional) Edit storage settings used for the exported virtual machine in Oracle Cloud Infrastructure. You can change the following settings:
-
The name of the bucket used to store the exported files.
-
Whether to store the custom image in Oracle Cloud Infrastructure.
-
The display name for the custom image in Oracle Cloud Infrastructure.
-
The launch mode for the cloud instance.
Paravirtualized mode gives improved performance and is suitable for most Oracle VirtualBox VMs.
Emulated mode is suitable for legacy OS images.
Click Finish to continue.
-
-
(Optional) Depending on the selection in the Machine Creation field, the Appliance Settings page may be displayed before or after export. This screen enables you to configure settings for the cloud instance, such as Shape and Disk Size.
Click Finish. The VM is exported to Oracle Cloud Infrastructure.
Depending on the Machine Creation setting, a cloud instance may be started after upload to Oracle Cloud Infrastructure is completed.
-
Monitor the export process by using the Oracle Cloud Console.
You can also use the VBoxManage export command to export a VM to Oracle Cloud Infrastructure. See VBoxManage export.
Preparing a VM for Export to Oracle Cloud Infrastructure
Oracle Cloud Infrastructure provides the option to import a custom Linux image. Before an Oracle VirtualBox image can be exported to Oracle Cloud Infrastructure, the custom image needs to be prepared to ensure that instances launched from the custom image can boot correctly and that network connections will work. This section provides advice on how to prepare a Linux image for export from Oracle VirtualBox.
The following list shows some tasks to consider when preparing an Oracle Linux VM for export:
-
Use DHCP for network addresses. Configure the VM to use a DHCP server to allocate network addresses, rather than using a static IP address. The Oracle Cloud Infrastructure instance will then be allocated an IP address automatically.
-
Do not specify a MAC address. The network interface configuration for the VM must not specify the MAC address.
Remove the HWADDR setting from the
/etc/sysconfig/ifcfg-devicename
network script. -
Disable persistent network device naming rules. This means that the Oracle Cloud Infrastructure instance will use the same network device names as the VM.
-
Change the GRUB kernel parameters.
Add
net.ifnames=0
andbiosdevname=0
as kernel parameter values to theGRUB_CMDLINE_LINUX
variable. -
Update the GRUB configuration.
# grub2-mkconfig -o /boot/grub2/grub.cfg
-
Disable any
udev
rules for network device naming.For example, if an automated
udev
rule exists fornet-persistence
:# cd /etc/udev/rules.d # rm -f 70-persistent-net.rules # ln -s /dev/null /etc/udev/rules.d/70-persistent-net.rules
-
-
Enable the serial console. This enables you to troubleshoot the instance when it is running on Oracle Cloud Infrastructure.
-
Edit the
/etc/default/grub
file, as follows:-
Remove the
resume
setting from the kernel parameters. This setting slows down boot time significantly. -
Replace
GRUB_TERMINAL="gfxterm"
withGRUB_TERMINAL="console serial"
. This configures use of the serial console instead of a graphical terminal. -
Add
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200"
. This configures the serial connection. -
Add
console=tty0 console=ttyS0,115200
to theGRUB_CMDLINE_LINUX
variable. This adds the serial console to the Linux kernel boot parameters.
-
-
Regenerate the GRUB configuration.
# grub2-mkconfig -o /boot/grub2/grub.cfg
-
To verify the changes, reboot the machine and run the dmesg command to look for the updated kernel parameters.
# dmesg |grep console=ttyS0
-
-
Enable paravirtualized device support. You do this by adding the
virtio
drivers to theinitrd
for the VM.-
This procedure works only on machines with a Linux kernel of version 3.4 or later. Check that the VM is running a supported kernel:
# uname -a
-
Use the
dracut
tool to rebuildinitrd
. Add theqemu
module, as follows:# dracut –-logfile /var/log/Dracut.log --force --add qemu
-
Verify that the
virtio
drivers are now present ininitrd
.# lsinitrd |grep virtio
-
For more information about importing a custom Linux image into Oracle Cloud Infrastructure, see also:
Importing an Instance from Oracle Cloud Infrastructure
Perform the following steps to import a cloud instance from Oracle Cloud Infrastructure into Oracle VirtualBox:
-
Select File, Import Appliance.
In the Source drop-down list, select Oracle Cloud Infrastructure.
In the Profile drop-down list, select the cloud profile for your Oracle Cloud Infrastructure account.
Choose the required cloud instance from the list in the Machines field.
Click Next to make an API request to the Oracle Cloud Infrastructure service and display the Appliance Settings page.
-
(Optional) Edit settings for the new local virtual machine.
For example, you can edit the Name and Description that will be used for the VM.
Click Finish to import the instance from Oracle Cloud Infrastructure.
-
Monitor the import process by using the Oracle Cloud Console.
You can also use the VBoxManage import command to import an instance from Oracle Cloud Infrastructure. See VBoxManage import.
Importing an Instance: Overview of Events
The following describes the sequence of events when you import an instance from Oracle Cloud Infrastructure.
-
A custom image is created from the boot volume of the instance.
-
The custom image is exported to an Oracle Cloud Infrastructure object and is stored using Object Storage in the bucket specified by the user.
-
The Oracle Cloud Infrastructure object is downloaded to the local host. The object is a TAR archive which contains a boot volume of the instance in QCOW2 format and a JSON file containing metadata related to the instance.
-
The boot volume of the instance is extracted from the archive and a new VMDK image is created by converting the boot volume into the VMDK format. The VMDK image is registered with Oracle VirtualBox.
-
A new VM is created using the VMDK image for the cloud instance.
By default, the new VM is not started after import from Oracle Cloud Infrastructure.
-
The downloaded TAR archive is deleted after a successful import.
Using a Cloud Network
A cloud network is a type of network that can be used for connections from a local VM to a remote Oracle Cloud Infrastructure cloud instance.
To create and use a cloud network, do the following:
-
Set up a virtual cloud network on Oracle Cloud Infrastructure.
The following steps create and configure a virtual cloud network (VCN) on Oracle Cloud Infrastructure. The VCN is used to tunnel network traffic across the cloud.
-
Ensure that you have a cloud profile for connecting to Oracle Cloud Infrastructure. See Creating a Cloud Profile.
-
Run the following VBoxManage cloud command:
VBoxManage cloud --provider="OCI" --profile="vbox-oci" network setup
where
vbox-oci
is the name of your cloud profile.Other options are available for the VBoxManage cloud network setup command, to enable you to configure details for the VCN. For example, you can configure the operating system used for the cloud gateway instance and the IP address range used by the tunneling network. See VBoxManage cloud.
-
-
Register the new cloud network with Oracle VirtualBox.
Use the Network tool. See Configure Networking.
-
Add cloud network adaptors to the local VMs that will use the cloud network. See Cloud Networks.
Using VBoxManage Commands With Oracle Cloud Infrastructure
This section includes some examples of how VBoxManage commands can be used to integrate with Oracle Cloud Infrastructure and perform common cloud operations.
Creating a Cloud Profile
To create a cloud profile called vbox-oci
for Oracle Cloud Infrastructure as the cloud provider:
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 Oracle VirtualBox global configuration directory. For example, this is $HOME/.VirtualBox/oci_config
on a Windows host.
Listing Cloud Instances
To list the instances in your Oracle Cloud Infrastructure compartment:
VBoxManage cloud --provider="OCI" --profile="vbox-oci" list instances
Exporting an Oracle VirtualBox 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 Oracle VirtualBox
To import a cloud instance and create an Oracle VirtualBox 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 Oracle Cloud Infrastructure:
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 Oracle Cloud Infrastructure:
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 VBoxManage cloud.