This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| open_nebula_kvm_with_drbd [2020/02/23 12:48] – herwarth | open_nebula_kvm_with_drbd [2020/02/23 13:23] (current) – [Move front-end VM to new cluster] herwarth | ||
|---|---|---|---|
| Line 144: | Line 144: | ||
| < | < | ||
| zpool create -f data /dev/sda | zpool create -f data /dev/sda | ||
| + | </ | ||
| + | < | ||
| + | zpool list | ||
| + | NAME | ||
| + | data | ||
| </ | </ | ||
| ==== Configure system ==== | ==== Configure system ==== | ||
| + | <code - / | ||
| + | - # | ||
| + | + DNSStubListener=no | ||
| + | </ | ||
| + | < | ||
| + | cd /etc | ||
| + | rm resolv.conf | ||
| + | ln -s ../ | ||
| + | </ | ||
| I do not want to mount the ZFS filesystem. Just using it for zvols with DRBD9. | I do not want to mount the ZFS filesystem. Just using it for zvols with DRBD9. | ||
| <code - / | <code - / | ||
| Line 184: | Line 198: | ||
| interfaces: [eno1] | interfaces: [eno1] | ||
| </ | </ | ||
| + | ==== Install DRBD9 ==== | ||
| + | < | ||
| + | apt install drbd-dkms linstor-satellite drbd-utils | ||
| + | systemctl start linstor-satellite | ||
| + | systemctl enable linstor-satellite | ||
| + | </ | ||
| + | ===== Configure front-end ===== | ||
| + | ====DRBD9==== | ||
| + | In this case the front-end VM is the controller. So these commands add the back-end nodes to be managed by the controller. Make sure all the back-end nodes are installed. | ||
| + | < | ||
| + | linstor node create server1 172.16.2.x | ||
| + | linstor node create server2 172.16.2.y | ||
| + | linstor storage-pool create zfsthin server1 data data | ||
| + | linstor storage-pool create zfsthin server2 data data | ||
| + | linstor storage-pool list | ||
| + | ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ | ||
| + | ┊ StoragePool | ||
| + | ╞═════════════════════════════════════════════════════════════════════════════════════════════════════════════════╡ | ||
| + | ┊ DfltDisklessStorPool ┊ server1 ┊ DISKLESS ┊ ┊ ┊ ┊ False ┊ Ok ┊ | ||
| + | ┊ DfltDisklessStorPool ┊ server2 ┊ DISKLESS ┊ ┊ ┊ ┊ False ┊ Ok ┊ | ||
| + | ┊ data ┊ server1 ┊ ZFS_THIN ┊ data | ||
| + | ┊ data ┊ server2 ┊ ZFS_THIN ┊ data | ||
| + | ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ | ||
| + | </ | ||
| + | ====Linstor_un driver for DRBD9==== | ||
| + | < | ||
| + | apt install jq | ||
| + | </ | ||
| + | Do not try to do a git clone and symlink. It does not work. There are hard coded paths in this addon. | ||
| + | < | ||
| + | curl -L https:// | ||
| + | mv / | ||
| + | mkdir -p / | ||
| + | mv / | ||
| + | mv / | ||
| + | mv / | ||
| + | rm -rf / | ||
| + | chown -R oneadmin. / | ||
| + | </ | ||
| + | Edit the Open Nebula config to enable the addon | ||
| + | <code - / | ||
| + | . | ||
| + | . | ||
| + | VM_MAD = [ | ||
| + | | ||
| + | - ARGUMENTS | ||
| + | + ARGUMENTS | ||
| + | ] | ||
| + | . | ||
| + | . | ||
| + | TM_MAD = [ | ||
| + | | ||
| + | - ARGUMENTS = "-t 15 -d dummy, | ||
| + | + ARGUMENTS = "-t 15 -d dummy, | ||
| + | ] | ||
| + | . | ||
| + | . | ||
| + | DATASTORE_MAD = [ | ||
| + | | ||
| + | - ARGUMENTS | ||
| + | + ARGUMENTS | ||
| + | ] | ||
| + | </ | ||
| + | Add new TM_MAD_CONF section: | ||
| + | <code - / | ||
| + | . | ||
| + | . | ||
| + | TM_MAD_CONF = [ | ||
| + | NAME = " | ||
| + | DS_MIGRATE = " | ||
| + | ] | ||
| + | </ | ||
| + | Add new DS_MAD_CONF section: | ||
| + | <code - / | ||
| + | . | ||
| + | . | ||
| + | DS_MAD_CONF = [ | ||
| + | NAME = " | ||
| + | MARKETPLACE_ACTIONS = " | ||
| + | ] | ||
| + | </ | ||
| + | Enable snapshotting (only works on powered off VMs) | ||
| + | <code - / | ||
| + | -LIVE_DISK_SNAPSHOTS=" | ||
| + | +LIVE_DISK_SNAPSHOTS=" | ||
| + | </ | ||
| + | < | ||
| + | systemctl restart opennebula opennebula-sunstone | ||
| + | </ | ||
| + | ===== Create datastores ===== | ||
| + | < | ||
| + | su - oneadmin | ||
| + | </ | ||
| + | < | ||
| + | cat > system-ds.conf <<EOT | ||
| + | NAME=" | ||
| + | TYPE=" | ||
| + | STORAGE_POOL=" | ||
| + | AUTO_PLACE=" | ||
| + | CHECKPOINT_AUTO_PLACE=" | ||
| + | TM_MAD=" | ||
| + | EOT | ||
| + | </ | ||
| + | < | ||
| + | cat > images-ds.conf <<EOT | ||
| + | NAME=" | ||
| + | TYPE=" | ||
| + | STORAGE_POOL=" | ||
| + | AUTO_PLACE=" | ||
| + | DISK_TYPE=" | ||
| + | DS_MAD=" | ||
| + | TM_MAD=" | ||
| + | EOT | ||
| + | </ | ||
| + | < | ||
| + | onedatastore create system-ds.conf | ||
| + | onedatastore create images-ds.conf | ||
| + | </ | ||
| + | ===== Configure oneadmin SSH ===== | ||
| + | < | ||
| + | su - oneadmin | ||
| + | </ | ||
| + | < | ||
| + | ssh-keygen | ||
| + | cat ~/ | ||
| + | chown oneadmin: | ||
| + | chmod 600 ~/ | ||
| + | </ | ||
| + | < | ||
| + | cat << EOT > ~/ | ||
| + | Host * | ||
| + | StrictHostKeyChecking no | ||
| + | ConnectTimeout 5 | ||
| + | UserKnownHostsFile /dev/null | ||
| + | EOT | ||
| + | chmod 600 ~/ | ||
| + | </ | ||
| + | Now we need to copy it to all nodes. Set a password on the oneadmin user on all nodes first. When done you can disable the password on the back-end nodes by using the following command on all back-end nodes: passwd -d oneadmin | ||
| + | < | ||
| + | scp -r / | ||
| + | </ | ||
| + | Check if you can login to all nodes as the oneadmin user. And do a reboot on the front-end node to make sure. | ||
| + | < | ||
| + | shutdown -r now | ||
| + | </ | ||
| + | ===== Move front-end VM to new cluster ===== | ||
| + | I created the VM on a laptop and now I want to move it to a back-end node. In this case I move it to server1 and do not want to see it in Open Nebula. | ||
| + | |||
| + | Shutdown the VM and copy the qcow2 file to / | ||
| + | |||
| + | Create a VM with virt-manager using the import exsisting volume. Make sure you connect it to the mgmt bridge. | ||
| + | |||
| + | Enable boot on startup and reboot your back-end server. The VM should start automatically. Check with virt-manager on that server. | ||