The starting point our lab is the following:
1 STEP – PREPARE HOST SERVER
For our lab we’ll be realized on a host IBM System x3650 with Ubuntu 18.04 LTS installed and where will run our virtual environment.
1.1 STEP – INSTALL UBUNTU 18.04 LTS ON HOST SERVER
use this guide to proceed
for our case we need two cabled network ports and their’s own network parameters are:
IP Address (eno2): 10.20.81.2
IP Address (eno3): 10.20.82.2
1.2 STEP – INSTALL KVM (KERNEL-BASED VIRTUAL MACHINE) ON HOST
KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V), for our goal we’ve installed that on NODE as hypervisor by that :
$: sudo apt install bidge-utils qemu-kvm libvirt-bin virtinst
Once we’re done we can verify the install is successful by running
$: kvm-ok INFO: /dev/kvm exists KVM acceleration can be used
Restart our server so that the needed kvm and libvirt deamons come up.
1.3 STEP – CONFIGURE SSH KEYPAIR ON MAAS SERVER
We’ve to go back on our MAAS Server and run the following command:
$: sudo chsh -s /bin/bash maas $: sudo su - maas $: ssh-keygen -f ~/.ssh/id_rsa -N ''
Generating public/private rsa key pair. Created directory '/var/lib/maas/.ssh'. Your identification has been saved in /var/lib/maas/.ssh/id_rsa. Your public key has been saved in /var/lib/maas/.ssh/id_rsa.pub. The key fingerprint is: SHA256:ArHr/dnnBmehQxJOTOx3UGRuAf4bvl8WSZgCqQNlGd8 maas@HUBMAAS The key's randomart image is: +---[RSA 2048]----+ | . .B+.o+= | | +..*o+o .o | | o .+.o.Eoo . | | o o+ oo+ . .| | . . S+ oo. o | | . . . +.oo .| | . . =o o| | . o o. o | | o .+o.. | +----[SHA256]-----+
then add the public key to file
/home//.ssh/authorized_keys on the KVM host:
$: ssh-copy-id -i ~/.ssh/id_rsa @
Where $KVM_HOST represents the IP address of the KVM host and $USER represents a user on the KVM host with the permission to communicate with the libvirt daemon. The latter is achieved via group membership, typically the
$: ssh-copy-id -i ~/.ssh/id_rsa firstname.lastname@example.org /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/var/lib/maas/.ssh/id_rsa.pub" The authenticity of host '10.20.253.180 (10.20.253.180)' can't be established. ECDSA key fingerprint is SHA256:7sjsDkvRW+0tDUDFci/+UQb4qxLC1+fZv3lSxM6h7bg. Are you sure you want to continue connecting (yes/no)? yes +ù/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys email@example.com's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'firstname.lastname@example.org'" and check to make sure that only the key(s) you wanted were added.
now as user ‘maas’, test connecting to the KVM host with virsh:
$: virsh -c qemu+ssh://@/system list --all
for our lab is that
$: virsh -c qemu+ssh://email@example.com/system list --all Id Name State ----------------------------------------------------
1.4 STEP – CREATE BRIDGE NETWORKING ON HOST SERVER
Now on our Host we need to install the following packages:
$: sudo modprobe vhost_net $: sudo lsmod | grep vhost vhost_net 20480 0 vhost 32768 1 vhost_net macvtap 20480 1 vhost_net $: sudo nano /etc/modules
and adding the line
then edit /etc/netplan/01-netcfg.yaml and modify that like this:
# This file describes the network interfaces available on your system # For more information, see netplan(5).
network: version: 2 renderer: networkd ethernets: eno2: dhcp4: no dhcp6: no eno3: dhcp4: no dhcp6: no bridges: br0: interfaces: [eno2] dhcp4: no dhcp6: no addresses: [10.20.81.2/24] gateway4: 10.20.81.254 nameservers: addresses: [10.20.81.1] parameters: stp: false br1: interfaces: [eno3] dhcp4: no dhcp6: no addresses: [10.20.82.2/24]
to end that run
$: sudo netplan try $: sudo netplan apply
At this point our environment is almost ready, we need now to create the VM. To make that we have two way:
note: If you are following the guide dedicate to “Ubuntu Maas, Juju, Landscape and Openstack Cloud with Ubuntu 18.04 LTS Server Edition” continue with the second part here.
The third part is done see you to next one.
Disclaimer: All the tutorials included on this site are performed in a lab environment to simulate a real world production scenario. As everything is done to provide the most accurate steps to date, we take no responsibility if you implement any of these steps in a production environment.
“We learn from our mistakes”