Questo contenuto non è disponibile nella lingua selezionata.
Chapter 4. Migrating from Bare Metal to a RHEL-Based Self-Hosted Environment
4.1. Migrating to a Self-Hosted Environment Copia collegamentoCollegamento copiato negli appunti!
hosted-engine script to assist with the task. The script asks you a series of questions, and configures your environment based on your answers. The Manager from the standard Red Hat Virtualization environment is referred to as the BareMetal-Manager in the following procedure.
engine-setup in a standard installation, in the migration process engine-setup must be run manually so that you can restore the BareMetal-Manager backup file on the new Manager virtual machine beforehand.
- Run the
hosted-enginescript to configure the host to be used as a self-hosted engine node and to create a new Red Hat Virtualization virtual machine. - Back up the the engine database and configuration files using the
engine-backuptool, copy the backup to the new Manager virtual machine, and restore the backup using the--mode=restoreparameter ofengine-backup. Runengine-setupto complete the Manager virtual machine configuration. - Follow the
hosted-enginescript to complete the setup.
Prerequisites
- Prepare a new host with the ovirt-hosted-engine-setup package installed. See Section 2.1, “Initiating Self-Hosted Engine Deployment on Red Hat Enterprise Linux Hosts” for more information on subscriptions and package installation. The host must be a supported version of the current Red Hat Virtualization environment.
Note
If you intend to use an existing host, place the host in maintenance and remove it from the existing environment. See Removing a Host in the Administration Guide for more information. - Prepare storage for your self-hosted engine environment. The self-hosted engine requires a shared storage domain dedicated to the Manager virtual machine. This domain is created during deployment, and must be at least 68 GB. For more information on preparing storage for your deployment, see the Storage chapter of the Administration Guide.
Important
If you are using iSCSI storage, do not use the same iSCSI target for the shared storage domain and data storage domain. - Obtain the RHV-M Virtual Appliance by installing the rhvm-appliance package. The RHV-M Virtual Appliance is always based on the latest supported Manager version. Ensure the Manager version in your current environment is updated to the latest supported Y-stream version as the Manager version needs to be the same for the migration.
- To use the RHV-M Virtual Appliance for the Manager installation, ensure one directory is at least 5 GB. The
hosted-enginescript first checks if/var/tmphas enough space to extract the appliance files. If not, you can specify a different directory or mount external storage. The VDSM user and KVM group must have read, write, and execute permissions on the directory. - The fully qualified domain name of the new Manager must be the same fully qualified domain name as that of the BareMetal-Manager. Forward and reverse lookup records must both be set in DNS.
- You must have access and can make changes to the BareMetal-Manager.
- The virtual machine to which the BareMetal-Manager is being migrated must have the same amount of RAM as the physical machine from which the BareMetal-Manager is being migrated. If you must migrate to a virtual machine that has less RAM than the physical machine from which the BareMetal-Manager is migrated, see the following Red Hat Knowledgebase article: https://access.redhat.com/articles/2705841.
Procedure 4.1. Migrating to a Self-Hosted Environment
Initiating a Self-Hosted Engine Deployment
Note
If your original installation was version 3.5 or earlier, and the name of the management network is rhevm, you must modify the answer file before runninghosted-engine --deploy. For more information, see https://access.redhat.com/solutions/2292861.Run thehosted-enginescript. To escape the script at any time, use the CTRL+D keyboard combination to abort deployment. It is recommended to use thescreenwindow manager to run the script to avoid losing the session in case of network or terminal disruption. If not already installed, install the screen package, which is available in the standard Red Hat Enterprise Linux repository.yum install screen
# yum install screenCopy to Clipboard Copied! Toggle word wrap Toggle overflow screen
# screenCopy to Clipboard Copied! Toggle word wrap Toggle overflow hosted-engine --deploy
# hosted-engine --deployCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
In the event of session timeout or connection disruption, runscreen -d -rto recover thehosted-enginedeployment session.Configuring Storage
Select the type of storage to use.During customization use CTRL-D to abort. Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs3, nfs4)[nfs3]:
During customization use CTRL-D to abort. Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs3, nfs4)[nfs3]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - For NFS storage types, specify the full address, using either the FQDN or IP address, and path name of the shared storage domain.
Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/nfs
Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/nfsCopy to Clipboard Copied! Toggle word wrap Toggle overflow - For iSCSI, specify the iSCSI portal IP address, port, user name and password, and select a target name from the auto-detected list. You can only select one iSCSI target during the deployment.
Please specify the iSCSI portal IP address: Please specify the iSCSI portal port [3260]: Please specify the iSCSI portal user: Please specify the iSCSI portal password: Please specify the target name (auto-detected values) [default]:
Please specify the iSCSI portal IP address: Please specify the iSCSI portal port [3260]: Please specify the iSCSI portal user: Please specify the iSCSI portal password: Please specify the target name (auto-detected values) [default]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - For Gluster storage, specify the full address, using either the FQDN or IP address, and path name of the shared storage domain.
Important
Only replica 3 Gluster storage is supported. Ensure the following configuration has been made:- In the
/etc/glusterfs/glusterd.volfile on all three Gluster servers, setrpc-auth-allow-insecuretoon.option rpc-auth-allow-insecure on
option rpc-auth-allow-insecure onCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Configure the volume as follows:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/gluster_volume
Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/gluster_volumeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - For Fibre Channel, the host bus adapters must be configured and connected, and the
hosted-enginescript will auto-detect the LUNs available. The LUNs must not contain any existing data.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configuring the Network
The script detects possible network interface controllers (NICs) to use as a management bridge for the environment. It then checks your firewall configuration and offers to modify it for console (SPICE or VNC) access HostedEngine-VM. Provide a pingable gateway IP address, to be used by theovirt-ha-agentto help determine a host's suitability for running HostedEngine-VM.Please indicate a nic to set rhvm bridge on: (eth1, eth0) [eth1]: iptables was detected on your computer, do you wish setup to configure it? (Yes, No)[Yes]: Please indicate a pingable gateway IP address [X.X.X.X]:
Please indicate a nic to set rhvm bridge on: (eth1, eth0) [eth1]: iptables was detected on your computer, do you wish setup to configure it? (Yes, No)[Yes]: Please indicate a pingable gateway IP address [X.X.X.X]:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configuring the Virtual Machine
The script creates a virtual machine to be configured as the Red Hat Virtualization Manager, referred to in this procedure as HostedEngine-VM. Select for the boot device type, and the script will automatically detect the RHV-M Appliances available. Select an appliance.Copy to Clipboard Copied! Toggle word wrap Toggle overflow SpecifyYesif you want cloud-init to take care of the initial configuration of the Manager virtual machine. Specify for cloud-init to take care of tasks like setting the root password, configuring networking, and configuring the host name. Optionally, select if you have an existing cloud-init script to take care of more sophisticated functions of cloud-init. Specify the FQDN for the Manager virtual machine. This must be the same FQDN provided for the BareMetal-Manager.Note
For more information on cloud-init, see https://cloudinit.readthedocs.org/en/latest/.Copy to Clipboard Copied! Toggle word wrap Toggle overflow You must answerNoto the following question so that you can restore the BareMetal-Manager backup file on HostedEngine-VM before runningengine-setup.Automatically execute engine-setup on the engine appliance on first boot (Yes, No)[Yes]? No
Automatically execute engine-setup on the engine appliance on first boot (Yes, No)[Yes]? NoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the Manager domain name, root password, networking, hardware, and console access details.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configuring the Self-Hosted Engine
Specify the name for Host-HE1 to be identified in the Red Hat Virtualization environment, and the password for theadmin@internaluser to access the Administration Portal. Finally, provide the name and TCP port number of the SMTP server, the email address used to send email notifications, and a comma-separated list of email addresses to receive these notifications.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configuration Preview
Before proceeding, thehosted-enginescript displays the configuration values you have entered, and prompts for confirmation to proceed with these values.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Creating HostedEngine-VM
The script creates the virtual machine to be configured as HostedEngine-VM and provides connection details. You must manually runengine-setupafter restoring the backup file on HostedEngine-VM before thehosted-enginescript can proceed on Host-HE1.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Connect to the virtual machine using the VNC protocol with the following command. Replace FQDN with the fully qualified domain name or the IP address of the self-hosted engine node./bin/remote-viewer vnc://FQDN:5900
# /bin/remote-viewer vnc://FQDN:5900Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enabling SSH on HostedEngine-VM
SSH password authentication is not enabled by default on the RHV-M Virtual Appliance. Connect to HostedEngine-VM via VNC and enable SSH password authentication so that you can access the virtual machine via SSH later to restore the BareMetal-Manager backup file and configure the new Manager. Verify that thesshdservice is running. Edit/etc/ssh/sshd_configand change the following two options toyes:[...] PermitRootLogin yes [...] PasswordAuthentication yes
[...] PermitRootLogin yes [...] PasswordAuthentication yesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restart thesshdservice for the changes to take effect.systemctl restart sshd.service
# systemctl restart sshd.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Disabling BareMetal-Manager
Connect to BareMetal-Manager, the Manager of your established Red Hat Virtualization environment, and stop theovirt-engineservice and prevent it from running.systemctl stop ovirt-engine.service systemctl disable ovirt-engine.service
# systemctl stop ovirt-engine.service # systemctl disable ovirt-engine.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
Though stopping BareMetal-Manager from running is not obligatory, it is recommended as it ensures no changes are made to the environment after the backup is created. Additionally, it prevents BareMetal-Manager and HostedEngine-VM from simultaneously managing existing resources.Updating DNS
Update your DNS so that the FQDN of the Red Hat Virtualization environment correlates to the IP address of HostedEngine-VM and the FQDN previously provided when configuring thehosted-enginedeployment script on Host-HE1. In this procedure, FQDN was set as manager.example.com because in a migrated hosted-engine setup, the FQDN provided for the engine must be identical to that given in the engine setup of the original engine.Creating a Backup of BareMetal-Manager
- Ensure the management network (ovirtmgmt)is configured as a VM network before performing the backup. For more information, see Explanation of Settings and Controls in the New Logical Network and Edit Logical Network Windows in the Administration Guide.
Connect to BareMetal-Manager and run theengine-backupcommand with the--mode=backup,--file=FILE, and--log=LogFILEparameters to specify the backup mode, the name of the backup file created and used for the backup, and the name of the log file to be created to store the backup log.engine-backup --mode=backup --file=FILE --log=LogFILE
# engine-backup --mode=backup --file=FILE --log=LogFILECopy to Clipboard Copied! Toggle word wrap Toggle overflow Copying the Backup File to HostedEngine-VM
On BareMetal-Manager, secure copy the backup file to HostedEngine-VM. In the following example, manager.example.com is the FQDN for HostedEngine-VM, and /backup/ is any designated folder or path. If the designated folder or path does not exist, you must connect to HostedEngine-VM and create it before secure copying the backup from BareMetal-Manager.scp -p FILE LogFILE manager.example.com:/backup/
# scp -p FILE LogFILE manager.example.com:/backup/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Registering HostedEngine-VM
Register HostedEngine-VM with Red Hat Subscription Management and enable the required repositories. See Subscribing to the Required Entitlements in the Installation Guide.Restoring the Backup File on HostedEngine-VM
Use theengine-backuptool to restore a complete backup. If you configured the BareMetal-Manager database(s) manually duringengine-setup, follow the instructions at Section 6.2.3, “Restoring the Self-Hosted Engine Manager Manually” to restore the backup environment manually.- If you are only restoring the Manager, run:
engine-backup --mode=restore --file=file_name --log=log_file_name --provision-db --restore-permissions
# engine-backup --mode=restore --file=file_name --log=log_file_name --provision-db --restore-permissionsCopy to Clipboard Copied! Toggle word wrap Toggle overflow - If you are restoring the Manager and Data Warehouse, run:
engine-backup --mode=restore --file=file_name --log=log_file_name --provision-db --provision-dwh-db --restore-permissions
# engine-backup --mode=restore --file=file_name --log=log_file_name --provision-db --provision-dwh-db --restore-permissionsCopy to Clipboard Copied! Toggle word wrap Toggle overflow
If successful, the following output displays:You should now run engine-setup. Done.
You should now run engine-setup. Done.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configuring HostedEngine-VM
Configure the restored Manager virtual machine. This process identifies the existing configuration settings and database content. Confirm the settings. Upon completion, the setup provides an SSH fingerprint and an internal Certificate Authority hash.engine-setup
# engine-setupCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Synchronizing the Host and the Manager
Return to Host-HE1 and continue thehosted-enginedeployment script by selecting option 1:(1) Continue setup - oVirt-Engine installation is ready and ovirt-engine service is up
(1) Continue setup - oVirt-Engine installation is ready and ovirt-engine service is upCopy to Clipboard Copied! Toggle word wrap Toggle overflow The script displays the internal Certificate Authority hash, and prompts you to select the cluster to which to add Host-HE1.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Shutting Down HostedEngine-VM
Shut down HostedEngine-VM.shutdown -h now
# shutdown -h nowCopy to Clipboard Copied! Toggle word wrap Toggle overflow Setup Confirmation
Return to Host-HE1 to confirm it has detected that HostedEngine-VM is down.Copy to Clipboard Copied! Toggle word wrap Toggle overflow