Project

General

Profile

The ungleich virtualisation handbook » History » Version 4

Nico Schottelius, 11/06/2018 12:09 PM

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