Virtual Machine Migration Lab
Virtual Machine Migration Lab
Virtual Machine Migration Lab
Install NFS client and openssh server on server. Use following command.
sudo apt install nfs-client openssh-server -y
Enable root account and assign password to it. Use following commands.
Now generate ssh keys for both users (default user and root user). use following
commands. Press Enter at all prompts for both the commands.
ssh-keygen -t rsa
sudo ssh-keygen -t rsa
Now note down the IP address of both the hypervisor servers. Edit the /etc/hosts file.
Add following entries. **Replace IP address with your server IP address. Keep all
default entries as it is. Do not remove any earlier entry.
192.168.10.1 node1
192.168.10.2 node2
Check by using sudo ssh node1 from node2 and sudo ssh node2 from node1.
8. Connect Hypervisor to NFS Share
Perform this action on both the hypervisor machines (node1 and node2).
Open virt-manager using sudo virt-manager command. Right click on the
QEMU/KVM option and click details. Click the Storage tab. The default storage pool
will be shown. Stop the pool using first red button below. Then delete this pool using
second red button. Then click Add pool button(Plus sign). Provide the name as
default. In the type drop down list select netfs : Network Exported directory option.
Click Forward.
In the hostname field type IP address of the storage server. In the source path field
type the directory name as /vm-store. Click Finish.
Attach the operating system iso image to first hypervisor node CD/DVD that you
want to install on the VM within this VM.
Once the above VM is installed and running, you can migrate it. To migrate VM first
add second hypervisor to the virt-manager. To do this go to File and click Add
Coonection. In the window that opens click the check box - Connect to remote host.
Type node2 in the hostname field. Click the checkbox of Auto connect.
Click Connect.
Click The running VM and right click and click Migrate. In the window that opens,
click Advanced options and click the check box of Allow Unsafe. Then click Migrate.
If any error appears …. Check Firewall status and disable it using following command.