Project

General

Profile

The ungleich virtualisation handbook » History » Version 6

Jin-Guk Kwon, 11/06/2018 03:30 PM

1 1 Nico Schottelius
h1. The ungleich virtualisation handbook
2
3 5 Nico Schottelius
{{toc}}
4
5 1 Nico Schottelius
h2. Introduction
6
7
* A place is autonomous data center and does not share resources with another place.
8
* The storage clusters are separated so that they don't influence each other
9
* Networks are place local -> changing the place means changing the IP addresses
10
11
h2. Migrating a VM from one place to another
12
13 3 Nico Schottelius
* Find the VM id (*onevm list* in opennebula) ("SOURCE-VMID")
14
* Stop the VM (*onevm stop <SOURCE-VMID>*)
15 1 Nico Schottelius
* Locate the disk in ceph
16 3 Nico Schottelius
** Locate the correct ceph pool: *ceph osd lspools* ("SOURCE-POOL")
17
** rbd list -p <SOURCE-POOL> | grep <SOURCE-VMID>
18
** This gives you the *SOURCE-IMAGE-NAME*
19 1 Nico Schottelius
* Login to the *destination place* and find out the target ceph pool
20 3 Nico Schottelius
** Locate the correct ceph pool: *ceph osd lspools* (this is the TARGET-POOL)
21 4 Nico Schottelius
* We define the *TARGET-IMAGE-NAME* = import-SOURCE-VMID
22 1 Nico Schottelius
* Transfer the disk into the other place ceph cluster
23 6 Jin-Guk Kwon
** rbd export <SOURCE-POOL>/<SOURCE-IMAGE-NAME> - | ssh <ANY SERVER IN OTHER PLACE> "rbd import - <TARGET-POOL>/<TARGET-IMAGE-NAME>"
24 3 Nico Schottelius
* Create a new VM in the target place with the same parameters as the original VM
25
** CPU, VCPU, RAM, disk size
26 4 Nico Schottelius
** It's id is the *TARGET-VMID*
27 3 Nico Schottelius
* Stop the new VM
28 1 Nico Schottelius
* Locate the disk of the new VM
29 3 Nico Schottelius
** rbd list -p <TARGET-POOL> | grep <TARGET-VMID>
30 4 Nico Schottelius
** The name of this disk is *NEW-DISK-ID*
31 1 Nico Schottelius
* Delete the disk of the new VM
32 4 Nico Schottelius
** rbd rm <TARGET-POOL>/<NEW-DISK-ID>
33
* Move the imported image to replace the disk we deleted
34
** rbd mv <TARGET-POOL>/<TARGET-IMAGE-NAME> <TARGET-POOL>/<NEW-DISK-ID>
35
* Start the VM
36
* Checkout the network configuration, update the customer with the new network details
37 2 Nico Schottelius
38 1 Nico Schottelius
39
40
h2. See Also
41
42
* For storage see [[The ungleich ceph handbook]]