Coriolis provides a portable command line interface (CLI) available on Linux, Macos or Windows. It is already available in the VM appliance and it can be easily installed anywhere with “pip install python-coriolisclient”.
Basic usage
Coriolis uses Keystone for identity management and the CLI usage resembles the OpenStack client for setting the required variables. The easiest way to start is just to SSH into the VM appliance. The connection parameters are available in “/etc/kolla/admin-openrc.sh”:
1 2 3 4 5 6 7 8 9 |
OS_AUTH_URL=http://127.0.0.1:35357/v3 OS_IDENTITY_API_VERSION=3 OS_INTERFACE=internal OS_PASSWORD=<your password here> OS_PROJECT_DOMAIN_NAME=default OS_PROJECT_NAME=admin OS_TENANT_NAME=admin OS_USERNAME=admin OS_USER_DOMAIN_NAME=default |
Creating an endpoint for Oracle VM
To begin with, we need to store in Barbican the Oracle VM Manager credentials and connection information:
1 |
openstack secret store -p '{"username":"admin", "password":"your_password", "host":"your_ovm_host", "port": 7002, "allow_untrusted":true}' |
Replace username, password, host and port to match your Oracle VM Manager endpoint. Allow_untrusted is needed if your endpoint uses a self signed certificate for HTTPS.
The above call will return an output similar to:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
+---------------+-----------------------------------------------------------------------+ | Field | Value | +---------------+-----------------------------------------------------------------------+ | Secret href | http://127.0.0.1:9311/v1/secrets/eb3e0343-671e-4b8e-bfe2-1d7ef9848575 | | Name | None | | Created | 2017-08-19T17:44:06+00:00 | | Status | ACTIVE | | Content types | {u'default': u'text/plain'} | | Algorithm | aes | | Bit length | 256 | | Secret type | opaque | | Mode | cbc | | Expiration | None | +---------------+-----------------------------------------------------------------------+ |
Copy the “Secret href” in order to create the Coriolis endpoint along with a name, a description and the provider type (oracle_vm in this case):
1 |
coriolis endpoint create --provider oracle_vm --name OVM --description "My Oracle VM" --connection-secret http://127.0.0.1:9311/v1/secrets/eb3e0343-671e-4b8e-bfe2-1d7ef9848575 |
You can now list the endpoints with:
1 |
coriolis endpoint list |
The output will look like this:
1 2 3 4 5 |
+--------------------------------------+---------+----------------+-------------------+ | ID | Name | Type | Description | +--------------------------------------+---------+----------------+-------------------+ | 1769beb7-0fdf-4211-b47e-8d9056e757a5 | OVM1 | oracle_vm | My Oracle VM | +--------------------------------------+---------+----------------+-------------------+ |
It is recommended to validate the connection to make sure coriolis can properly connect to your Oracle VM Manager, using the ID of the connection:
1 |
coriolis endpoint validate connection 1769beb7-0fdf-4211-b47e-8d9056e757a5 |
In case of success, the command will exit with 0. In case of connection problems, you will get an error message for troubleshooting the issue.
Connections can be managed with coriolis endpoint show <id>, coriolis endpoint update <id> and coriolis endpoint delete <id>
Creating an endpoint for VMware vSphere
Similarly to the Oracle VM case, an endpoint can be created for your VMware vSphere endpoint:
1 |
openstack secret store -p '{"username": "your_user@vsphere.local", "password": "your_password", "host": "your_vsphere_host", "port": 443, "allow_untrusted": true}’ |
1 |
coriolis endpoint create --provider vmware_vsphere --name VMware --description "My VMware vSphere" --connection-secret <secret_href> |
1 |
coriolis endpoint validate connection <id> |
Configuring a replica for a VM from vSphere to Oracle VM
At this point you should have two valid endpoints configured in Coriolis:
1 |
coriolis endpoint list |
1 2 3 4 5 6 |
+--------------------------------------+---------+----------------+-------------------+ | ID | Name | Type | Description | +--------------------------------------+---------+----------------+-------------------+ | 1769beb7-0fdf-4211-b47e-8d9056e757a5 | OVM | oracle_vm | My Oracle VM | | 9f4ee75c-215d-48e8-9a0f-e337fbdf4581 | VMware | vmware_vsphere | My VMware vSphere | +--------------------------------------+---------+----------------+-------------------+ |
If you don’t know the name of the VMs to replicate, you can just list them with coriolis endpoint instance list.
For example the following command will list the first 10 VMs with a name containing “oracle”:
1 |
coriolis endpoint instance list 9f4ee75c-215d-48e8-9a0f-e337fbdf4581 --limit 10 --name 'oracle' |
1 2 3 4 5 |
+---------+-----------------------+--------+-----------+-------+---------+ | ID | Name | Flavor | Memory MB | Cores | OS Type | +---------+-----------------------+--------+-----------+-------+---------+ | vm-157 | Oracle Linux 7 | | 2048 | 4 | linux | +---------+-----------------------+--------+-----------+-------+---------+ |
We need to let Coriolis know about how to map the networks between origin (VMware) and destination (Oracle VM) and what server pool to use:
1 |
REPLICA_ENV='{"network_map": {"VM Network": "management"}, "server_pool_name": "pool1"}' |
In this example, the VMware network is called “VM Network” and the corresponding network on Oracle VM is called “management”. Beside the Oracle VM server pool name, you can also pass a repository name with the “repository_name” option.
We can now create the replica:
1 |
coriolis replica create --origin-endpoint 9f4ee75c-215d-48e8-9a0f-e337fbdf4581 --destination-endpoint 1769beb7-0fdf-4211-b47e-8d9056e757a5 --instance "Your VM Name” --destination-environment "$REPLICA_ENV" |
Note: to replicate a group of VMs, just add more “–instance <VM name>” clauses.
You can list the replicas with:
1 |
coriolis replica list |
Performing the replica
Now it’s time to get Coriolis copy all the VM data from VMware to Oracle VM. The first time it will perform a full copy of the content of the VM, while from the second time onwards it will only copy incrementally the data that changed:
1 |
coriolis replica execute <replica_id> |
Add –shutdown-instances in case you would like Coriolis to shutdown the VMs before the replica starts.
This will return an ID that identifies this particular execution along with info about all the tasks that will need to be completed as part of the process.
You can now check the status of the execution:
1 |
coriolis replica execution show <replica_id> <execution_id> |
Depending on the size of the VM, this might take a while, so this is a perfect time to grab a coffee and periodically check on the status.
In case of errors, Coriolis will also give you all the information available, for example letting you know if Change Block Tracking (CBT) is not enabled on the VMware VM.
Once completed, you will have a 1-1 copy of all the content of the VM on your Oracle VM environment. If you execute the replica again you will notice that this time it is way faster, due to the incremental feature that copies only the bytes that changed since the last execution.
Since the data is fully replicated on the target infrastructure you won’t be affected by any failure on the source, allowing disaster recovery scenarios.
Migrating the VM from the replica
Since the replica execution completed, we can now get the VM to run on Oracle VM. This requires a migration:
1 |
coriolis migration deploy replica <replica id> |
The command will return a migration id and info about the tasks that are going to be executed.
Like for the replica case, you can check the status of the migration:
1 |
coriolis migration show <migration_id> |
You can also list all migrations at once to get an overview of the status:
1 |
coriolis migration list |
Once the migration is completed, your VM will be up and running in Oracle VM!
Troubleshooting
In a complex environment involving multiple clouds it becomes useful to get detailed information about possible issues. Coriolis logs all errors, warnings and other details in the /var/log/coriolis folder.