In this review, you will migrate a virtual machine from one host to another and move a virtual machine from one cluster to another.
Outcomes
You should be able to:
Migrate virtual machines between hosts.
Create an NFS export storage domain.
Export a virtual machine from one data center and import it to another.
Log in as the student user on workstation and run the lab image-cr start command.
This command creates the rh1 and rh2 virtual machines, and ensures that the hostb.lab.example.com and hostc.lab.example.com RHV-H hosts are active in the datacenter1 data center.
This command also ensures that the hostd.lab.example.com RHV-H host is active in the datacenter2 data center.
[student@workstation ~]$lab image-cr start
Instructions
Accomplish the following tasks.
Ensure that the rh1 virtual machine successfully live migrates to another host in the cluster.
Manually live migrate rh1 to confirm this behavior.
Create a new NFS export domain named movestorage using 172.24.0.8:/exports/data2 as the NFS export path.
Use this NFS export domain to export and import the rh2 virtual machine from datacenter1 to datacenter2 respectively.
The imported VM should be named rh2-dc2 and must have its NIC attached to the ovirtmgmt logical network.
Set RHV Managed Virtual Machine as the custom message of the day in rh2.
The URL for the Administration Portal is https://rhvm.lab.example.com.
The username is admin and the password is redhat.
Use the internal profile.
Start the rh1 virtual machine.
After the rh1 virtual machine is started, manually live migrate the rh1 virtual machine to run on another host in the cluster.
On workstation, use Firefox to log in to RHV-M Administration Portal as admin from the internal profile, using redhat as the password.
The URL for the Administration Portal is https://rhvm.lab.example.com.
From the menu, navigate to → to access the Compute >> Virtual Machines page.
From the list of virtual machines, select rh1 and click to start the virtual machine.
It may take a minute for the virtual machine to start.
View the Host field for rh1 to determine the host it is currently using.
From Compute >> Virtual Machines page, select rh1.
Click to migrate rh1 from the current host to the other available host in the cluster.
The window titled Migrate VM(s) displays.
In the Migrate VM(s) window, leave Automatically Choose Host selected for the Destination Host field.
Click to confirm your intention to migrate rh1.
Wait until the Status for the virtual machine transitions from Migrating From: 0% to Up.
Verify that the Host field for rh1 has changed to a different host in the cluster.
To support exporting the rh2 virtual machine from datacenter1 and importing to datacenter2, create a new NFS export domain named movestorage.
Use the NFS export 172.24.0.8:/exports/data2 as the back-end storage for movestorage.
From the menu, navigate to → to access the Storage >> Storage Domains page.
Click to create a new storage domain. The window titled New Domain displays.
In the New Domain window, set the values of the fields according to the following table, and click to create the storage domain.
| Field | Value |
|---|---|
| Data Center | |
| Domain Function | |
| Storage Type | |
| Host to Use | |
| Name | movestorage |
| Export Path | 172.24.0.8:/exports/data2 |
Verify that the Cross Data Center Status is Active for the movestorage storage domain.
It may take a minute for the status to transition from Locked to Active.
Set RHV Managed Virtual Machine as the custom message of the day in rh2.
Use this message of the day to verify that the rh2 virtual machine was successfully exported and imported.
When the movestorage storage domain becomes active, navigate to → to access the Compute >> Virtual Machines page.
In the Compute >> Virtual Machines page, right-click the row for rh2 and select to start the virtual machine.
After the virtual machine is started, click to access the console of rh2.
The Opening console.vv window opens and prompts for your confirmation to open the connection file (console.vv).
Click to open the console.vv file using Remote Viewer.
If Remote Viewer prompts for your confirmation to inhibit shortcuts, click .
Log in to rh2 as root with the password redhat.
Run the echo "RHV Managed Virtual Machine" >> /etc/motd command to append the /etc/motd file with the given message.
Also, run the sync command to flush the Linux buffer cache to the disk so that the changes in /etc/motd gets successfully written to the disk.
Log out from rh2 and close the console of the virtual machine.
Export the rh2 virtual machine from the datacenter1 data center.
Right-click the row for the rh2 virtual machine, and click .
The window titled Power Off Virtual Machine(s) displays.
Click to confirm your intention of powering down the virtual machine.
In the Compute >> Virtual Machines page, verify that the value of the Status field for rh2 is Down.
Select the rh2 virtual machine and click the three vertical dots next to the button.
From the menu that displays, click .
The window titled Export Virtual Machine displays.
In the Export Virtual Machine window, ignore the two check boxes and click to confirm exporting the virtual machine.
While rh2 is being exported, the Status field for rh2 displays Image Locked.
After rh2 gets successfully exported, the value of the Status field transitions from Image Locked to Down.
Navigate to menu, and search for the log message containing Vm rh2 was exported successfully to movestorage.
This log message confirms that the rh2 virtual machine was successfully exported.
Detach the movestorage export domain from datacenter1 and attach it to datacenter2.
From the menu, navigate to → to access the Compute >> Data Centers page.
In the Compute >> Data Centers page, click on the name of the datacenter1 data center.
In the Storage tab for datacenter1, select movestorage and click .
The window titled Storage Domain maintenance displays.
Click to confirm your intention of marking movestorage for maintenance.
Wait for the status of movestorage to transition to Maintenance.
It may take a minute for the status to transition from Active to Maintenance.
In the Compute >> Data Centers >> datacenter1 page, select movestorage and click to detach it from datacenter1.
The window titled Detach Storage displays. Click to confirm detaching the export domain.
From the menu, navigate to → to access the Compute >> Data Centers page.
In the Compute >> Data Centers page, click on the name of the datacenter2 data center.
In the Storage tab for datacenter2, click .
The window titled Attach Export Domain displays.
In the Attach Export Domain window, click the radio button next to movestorage.
Click to confirm attaching the export domain.
Wait for the activation of movestorage to be complete.
It may take a minute for the status to transition from Locked to Active.
Import the rh2 virtual machine to the datacenter2 data center as rh2-dc2.
From the menu, navigate to → to access the Storage >> Storage Domains page.
In the Storage >> Storage Domains page, click on the name of movestorage.
In the Storage >> Storage Domains >> movestorage page that displays, click on the VM Import tab.
In the VM Import tab, click the row for rh2, and click .
The window titled Import Virtual Machine(s) displays.
In the Import Virtual Machine(s) window, click to confirm importing the virtual machine.
After you click , a warning sign is displayed next to the name of the virtual machine.
Hover over the warning sign and confirm that the warning is regarding the name of the virtual machine.
Click on the warning sign and change the name of the virtual machine from rh2 to rh2-dc2 from the General tab of the Import Virtual Machine(s) window.
Click to confirm the change in name and import the virtual machine.
The Import Virtual Machine(s) window displays a message about the start of the import process, which can be tracked from the menu. Click to close the Import Virtual Machine(s) window.
Verify that the rh2 virtual machine from datacenter1 has been successfully imported as rh2-dc2 to datacenter2
From the menu, navigate to to search for the log messages related to the import of the virtual machine.
Search for the log message containing Vm rh2-dc2 was imported successfully to Data Center datacenter2, Cluster cluster2.
This log message confirms that the virtual machine has been successfully imported.
It may take a couple of minutes for the log message to display.
Remove any existing NIC from rh2-dc2, and create a NIC for rh2-dc2 from the ovirtmgmt logical network.
From the menu, navigate to → to access the Compute >> Virtual Machines page.
In the Compute >> Virtual Machines page, click on the name of the rh2-dc2 virtual machine to access the Compute >> Virtual Machines >> rh2-dc2 page.
In the Compute >> Virtual Machines >> rh2-dc2 page, click on the Network Interfaces tab.
Click to remove nic1 that uses [N/A] as the value of the Network Name field, from the rh2-dc2 virtual machine.
The window titled Remove Network Interface(s) displays.
In the Remove Network Interface(s), click to confirm the removal of the NIC.
Click to add a new NIC to rh2-dc2 from ovirtmgmt logical network.
The New Network Interface window displays.
In the New Network Interface window, ensure that the Name is nic1, the Profile is , and the Type is .
Leave the other fields to their default values and click to confirm adding the NIC.
Confirm that the Network Name for the newly added nic1 is ovirtmgmt.
From the menu, navigate to → to access the Compute >> Virtual Machines page.
Click on the row for the rh2-dc2 virtual machine, and click to start rh2-dc2.
Verify that rh2-dc2 has an IP address configured in the 172.25.250.0/24 subnet range in its eth0 network interface.
Click on the row for the rh2-dc2 virtual machine, and click to access the console of rh2-dc2.
The Opening console.vv window opens and prompts for your confirmation to open the connection file (console.vv).
Click to open the console.vv file using Remote Viewer.
Log in to rh2-dc2 as root with the password redhat.
On successful login, you should see the RHV Managed Virtual Machine message you configured previously.
Run the ip address show command to view the network configuration of the virtual machine.
Confirm that the virtual machine has an IP address in the 172.25.250.0/24 subnet range.
Log out from rh2-dc2 and close the console of the virtual machine.