Skip to content
Douglas Schilling Landgraf edited this page Oct 18, 2017 · 73 revisions

Welcome to the rhevUP wiki!
An Open Source Disaster Recovery and Migration tool for Red Hat Enterprise Virtualization (RHEV) 2.x series

About

rhevUP is a console tool written in C# for Microsoft Windows 2003/2008 which contain the following goals:

  • Backup current RHEV environment on Windows
  • Restore RHEV environment on Windows
  • Migrate RHEV environment from Windows 2003 to Windows 2008

Please note 1: The backup doesn't include storage or RHEV-H side.
Please note 2: Red Hat DOES NOT support it. It's open source project.

License: GPLv2
Libraries: rhevUP uses the GNU Getopt library (LGPL) for .NET (http://getopt.codeplex.com/)

Supported Environment:

  • Microsoft Windows 2003
  • Microsoft Windows 2008
  • Active Directory
  • Local Computer Account

Download

https://github.com/dougsland/rhevUP/downloads

How can I use it?

rhevUP offers the following options: -n SQL serverName (Ex.: [Machine Name]\sqlexpress) -s Source directory which contains the backup for restore -r Restore RHEV Environment -b Backup RHEV Environment -q Quit after backup -i IIS wwwroot path (Ex.: c:\inetpub\wwwroot) -p path RHEVM files (Ex.:c:\Program Files\RedHat\RHEVManager)

Ex.: (backup):
C:>rhevUP -b -n "[Machine Name]\sqlexpress" -d C:\myBackupDir -i C:\inetpub\wwwroot -p c:\Program Files\RedHat\RHEVManager```

Ex.: (scripting (backup mode)):
C:>rhevUP -q -b -n "[Machine Name]\sqlexpress" -d C:\myBackupDir -i C:\inetpub\wwwroot -p c:\Program Files\RedHat\RHEVManager

Ex.: (restore):
C:>rhevUP -r -n "[Machine Name]\sqlexpress" -s C:\myBackupDir -i C:\inetpub\wwwroot -p c:\Program Files (x86)\RedHat\RHEVManager```

backup mode will backup the following files:

  • Certificates
  • rhevm and rhevm_history Databases
  • .config files
  • Service directory
  • Turn off all all RHEV Windows Services

After backup complete, the program will ask if you would like to turn off your computer.

restore mode will restore the configuration

scripting mode this mode will do exactly the same as backup mode but also will turn on the RHEV Windows Service after the backup.
To schedule a task on Windows, please verify: http://msdn.microsoft.com/en-us/library/bb756979.aspx

Source code

https://github.com/dougsland/rhevUP

Developers

If you would like to help the project, below some tips:

Example:
ILMerge.exe /t:exe /out:merged-rhevUP.exe rhevUP.exe Gnu.Getopt.dll

References required to build the project:
System.ServiceProcess
Gnu.Getopt
System
System.Core
System.Data
System.Data.DataSetExtensions
System.Management
System.XML
System.XML.Linq

Can I do manually the work?

on Windows 2003 (backup data)

  1. Stop all RHEVM Service

  2. Backup databases
    rhevm
    rhevm_history (in case exists)

  3. Backup Service CA directory
    C:\Program Files\RedHat\RHEVManager\Service\ca

  4. Backup private key, CA Certs, .config Files and XML
    C:\Program Files\RedHat\RHEVManager\Service\rhevm.pfx
    C:\Program Files\RedHat\RHEVManager\Service\rhevm.ssh.key
    C:\Program Files\RedHat\RHEVManager\Service\RHEVManager.exe.config
    C:\Program Files\RedHat\RHEVManager\Service\RHEVMHistoryService.exe.config
    C:\Program Files\RedHat\RHEVManager\Service\RHEVMNotificationService.exe.config
    C:\Program Files\RedHat\RHEVManager\Service\FieldsInVDCConfig.xml
    C:\Inetpub\wwwroot\ca.crt
    C:\Inetpub\wwwroot\rhevm.ssh.key.txt

  5. Backup the current certificates installed (using mmc) from Local Computer Account on:

  • Trusted Root Certificate Authorities with subject RHEVM CA
  • Trusted Publishers with Subject Red Hat
  • Personal certs with Subject your RHEV-M host

Restoring the data on Windows 2008
0) Make sure you have configured the same DNS entry from the previous machine

  1. Install a clean RHEV-M software

  2. Stop all RHEV-M services

  3. Restore the databases

  4. Replace (do a backup first of your current files) the following files from your backup:
    C:\Program Files\RedHat\RHEVManager\Service\ca\ca.pem
    C:\Program Files\RedHat\RHEVManager\Service\ca\private\ca.pem
    C:\Inetpub\wwwroot\ca.crt
    C:\Inetpub\wwwroot\rhevm.ssh.key.txt
    C:\Program Files\RedHat\RHEVManager\Service\rhevm.pfx

5)To rhevm.pfx file, add FULL Control permission to Network Service user.
6) Restore your certificates on Local Computer account (using mmc)

  1. Start all RHEVM Windows Services

Screenshots

Help menu
help menu

Backup mode
Backup mode - screenshot 1
Backup mode - screenshot 2

Restore mode
Restore mode - screenshot

Schedule Backup
Schedule Backup

RHEV Environment after backup/restore
RHEV environment

Reports

How can I get the SQL Server Name?

Usually it's your machine name\sqlexpress but you can see it opening the SQL Server Management Studio Express and check the Server Name.

SQL ServerName

User is not authorized to perform this action (Local Computer Account or different Active Directory)

The migration from Windows 2003 to Windows 2008 worked just fine but I cannot login anymore to RHEV Admin Portal, received the message "User is not authorized to perform this action". What happened?

This issue happens because when you use Local Computer accounts or a different Active Directory, their id objects are uniques for that machine (Windows2003 or Windows2008) and moving these users to a new machine or Active Directory they will adquire a new id object (this is not true/needed when SAME use Active Directory).

To fix:

0 - Download Microsoft SQL Server Management Studio Express and use it to execute below steps
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796

1 - To proceed, we need to identify userid from each RHEV user.
use rhevm;
select * from dbo.users;

Example:

userid name surname domain
D0ECDCE4-431A-4E5C-8888-51D373F520B4 Douglas Landgraf mydomain
38EABAB1-80CA-53A0-CBE5-5C75ED030000 Doug NULL mydomain
4D0F173A-92EB-A925-43FF-AC8BF4030000 rhevadmin NULL mydomain

2 - Now we need to check which permissions which user has. Please check the field ad_element_id against userid and check the role_id field.
use rhevm;
select * from dbo.permissions;

id role_id is_readonly ad_element_id
18133e7e-45f0-4dd7-bd56-051374a71d0a 00000000-0000-0000-0000-000000000001 False 22567dd9-97b7-4957-9734-81b4decd2990
822edce8-eec2-451f-aead-4d559b6268b4 00000000-0000-0000-0000-000000000001 False 4d0f173a-92eb-a925-43ff-ac8bf4030000
4fc16cf4-645b-4b53-b22a-83fee7377c4f 00000000-0000-0000-0001-000000000003 False 38eabab1-80ca-53a0-cbe5-5c75ed030000
6ea9a353-37a1-4fce-8b2a-ad83275bad26 00000000-0000-0000-0001-000000000001 False d0ecdce4-431a-4e5c-8888-51d373f520b4
20525e30-3ecc-4320-af8f-c3abedf4ad1a 00000000-0000-0000-0001-000000000001 False 38eabab1-80ca-53a0-cbe5-5c75ed030000
4089d3c5-d5f5-4abc-92a5-d13e49a8b4e3 00000000-0000-0000-0001-000000000003 False d0ecdce4-431a-4e5c-8888-51d373f520b4

Where:
00000000-0000-0000-0000-000000000001 = Able to login
00000000-0000-0000-0001-000000000003 = Not able to login

If you would like to see more details about roles, check below:
use rhevm;
select * from dbo.roles;

id name description is_readonly
00000000-0000-0000-0000-000000000001 SuperUser Roles management administrator True
00000000-0000-0000-0001-000000000001 RHEVMUser RHEVM user True
00000000-0000-0000-0001-000000000002 RHEVMPowerUser RHEVM power user True
00000000-0000-0000-0001-000000000003 RHEVMVDIUser RHEVM VDI user True

So, How to fix the issue?

use rhevm;
update dbo.permissions set role_id='00000000-0000-0000-0000-000000000001' where ad_element_id='user_id entry from users table';

Contact

Please share your experience: dougsland at gmail dot com