what order backup and restore rhev-m config and database?

Latest response

1. backup config files

 

/etc/jbossas/jbossas.conf

/etc/rhevm/

/etc/yum/pluginconf.d/versionlock.list

/etc/pki/rhevm/

/etc/jbossas/rhevm-slimmed/

/usr/share/rhevm/kerberos/krb5.conf

/usr/share/rhevm/rhevm.ear/rhevmanager.war/ExternalConfig.txt

/usr/share/rhevm/rhevm.ear/rhevmanager.war/ServerParameters.js

/root/.pgpass

/root/.rnd

 

2. backup rhev-m db

pg_dump -C -E UTF8 --column-inserts --disable-dollar-quoting --disable-triggers -U postgres --format=p -f dump_RHEVDB_BACKUP.sql rhevm

3. on new host install rhev-m

 

yum install rhevm

service jbossas stop

 

4. restore backup db

 

psql -U postgres -d rhevm -W -f dump_RHEVDB_BACKUP.sql
5. restore config files
6. service jbossas start

But rhev-m not work.

Log file /var/log/rhevm/rhevm.log:

 

[org.ovirt.engine.core.bll.Backend] (main) Error in getting DB connection. The database is inaccessible. Original exception is: DataAccessResourceFailureException: Error retreiving database metadata; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.jboss.util.NestedSQLException: Unable to get managed connection for RHEVMDataSource; - nested throwable: (javax.resource.ResourceException: Unable to get managed connection for RHEVMDataSource)
 

What am I doing wrong?

Responses

Please make the third step as below.

 

# yum install rhevm

# rhevm-setup

 

Complete the rhevm-setup with the same value used for the original setup. If hostname has changed, use the new hostname.

 

Then do "service jbossas stop".

 

Proceed to step #4.

ok.

Rhev-m work, but now i can not login.

 

Now in log file:

 

2013-01-04 10:43:11,546 INFO  [org.ovirt.engine.core.bll.Backend] (main) Start time: 1/4/13 10:43 AM
2013-01-04 10:43:11,627 WARN  [org.ovirt.engine.core.utils.ConfigUtilsBase] (main) Could not find enum value for option: CARhevmKey
2013-01-04 10:43:11,672 ERROR [org.ovirt.engine.core.rhevmencryptutils.EncryptionUtils] (main) Failed to decrypt
2013-01-04 10:43:11,672 ERROR [org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils] (main) Failed to decrypt value for property LocalAdminPassword will be used encrypted value
2013-01-04 10:43:11,676 ERROR [org.ovirt.engine.core.rhevmencryptutils.EncryptionUtils] (main) Failed to decrypt
2013-01-04 10:43:11,676 ERROR [org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils] (main) Failed to decrypt value for property TruststorePass will be used encrypted value
2013-01-04 10:43:11,682 WARN  [org.ovirt.engine.core.utils.ConfigUtilsBase] (main) Could not find enum value for option: CbcCheckOnVdsChange
2013-01-04 10:43:12,046 WARN  [org.ovirt.engine.core.utils.ConfigUtilsBase] (main) Could not find enum value for option: ScriptsPath
2013-01-04 10:43:12,047 WARN  [org.ovirt.engine.core.utils.ConfigUtilsBase] (main) Could not find enum value for option: SQLServerI18NPrefix
2013-01-04 10:43:12,055 WARN  [org.ovirt.engine.core.utils.ConfigUtilsBase] (main) Could not find enum value for option: MinimalETLVersion
2013-01-04 10:43:12,056 WARN  [org.ovirt.engine.core.utils.ConfigUtilsBase] (main) Could not find enum value for option: RHEVMEARLib
2013-01-04 10:43:12,061 ERROR [org.ovirt.engine.core.rhevmencryptutils.EncryptionUtils] (main) Failed to decrypt
2013-01-04 10:43:12,062 ERROR [org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils] (main) Failed to decrypt value for property CertificatePassword will be used encrypted value
2013-01-04 10:43:12,065 ERROR [org.ovirt.engine.core.rhevmencryptutils.EncryptionUtils] (main) Failed to decrypt
2013-01-04 10:43:12,065 ERROR [org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils] (main) Failed to decrypt value for property AdminPassword will be used encrypted value
2013-01-04 10:43:12,070 INFO  [org.ovirt.engine.core.bll.Backend] (main) VDSBrokerFrontend: 1/4/13 10:43 AM
2013-01-04 10:43:12,077 INFO  [org.ovirt.engine.core.bll.Backend] (main) CpuFlagsManager: 1/4/13 10:43 AM
2013-01-04 10:43:12,079 INFO  [org.ovirt.engine.core.bll.AuditLogCleanupManager] (main) Setting audit clean up manager to run at: 35 35 3 * * ?
2013-01-04 10:43:12,125 INFO  [org.ovirt.engine.core.bll.Backend] (main) AuditLogCleanupManager: 1/4/13 10:43 AM
2013-01-04 10:43:12,135 INFO  [org.ovirt.engine.core.bll.TagsDirector] (main) TagsDirector initialization
2013-01-04 10:43:12,157 INFO  [org.ovirt.engine.core.bll.TagsDirector] (main) Tag root added to tree
2013-01-04 10:43:12,183 INFO  [org.ovirt.engine.core.bll.Backend] (main) TagsDirector: 1/4/13 10:43 AM
2013-01-04 10:43:12,192 INFO  [org.ovirt.engine.core.bll.Backend] (main) ImagesSyncronizer: 1/4/13 10:43 AM
2013-01-04 10:43:12,203 INFO  [org.ovirt.engine.core.bll.Backend] (main) IsoDomainListSyncronizer: 1/4/13 10:43 AM
2013-01-04 10:43:12,235 INFO  [org.ovirt.engine.core.bll.Backend] (main) InitHandlers: 1/4/13 10:43 AM
2013-01-04 10:43:12,250 INFO  [org.ovirt.engine.core.bll.Backend] (main) ErrorTranslator: 1/4/13 10:43 AM
2013-01-04 10:43:12,251 INFO  [org.ovirt.engine.core.bll.Backend] (main) VdsErrorTranslator: 1/4/13 10:43 AM
2013-01-04 10:43:12,418 INFO  [org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManagerService] (main) UsersDomainsCacheManager: 1/4/13 10:43 AM
2013-01-04 10:43:12,455 INFO  [org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManagerService] (main) DbUserCacheManager: 1/4/13 10:43 AM
2013-01-04 10:43:12,640 INFO  [org.ovirt.engine.core.bll.DbUserCacheManager] (QuartzScheduler_Worker-1) DbUserCacheManager::refreshAllUserData() - entered
2013-01-04 10:43:12,943 INFO  [org.ovirt.engine.core.bll.InitBackendServicesOnStartupBean] (main) InitResourceManager: 1/4/13 10:43 AM
2013-01-04 10:43:12,994 INFO  [org.ovirt.engine.core.vdsbroker.ResourceManager] (main) ResourceManager::ResourceManager::Entered
2013-01-04 10:43:13,182 INFO  [org.ovirt.engine.core.bll.AsyncTaskManager] (main) AsyncTaskManager: Initialization of AsyncTaskManager completed successfully.
2013-01-04 10:43:13,182 INFO  [org.ovirt.engine.core.bll.InitBackendServicesOnStartupBean] (main) AsyncTaskManager: 1/4/13 10:43 AM
2013-01-04 10:43:13,187 INFO  [org.ovirt.engine.core.bll.InitBackendServicesOnStartupBean] (main) VdsLoadBalancer: 1/4/13 10:43 AM
2013-01-04 10:43:13,229 INFO  [org.ovirt.engine.core.bll.TimeLeasedVmPoolManager] (main) TimeLeasedVmPoolManager constractor entered
2013-01-04 10:43:13,230 INFO  [org.ovirt.engine.core.bll.InitBackendServicesOnStartupBean] (main) TimeLeasedVmPoolManager: 1/4/13 10:43 AM
2013-01-04 10:43:13,270 INFO  [org.ovirt.engine.core.bll.InitBackendServicesOnStartupBean] (main) MacPoolManager: 1/4/13 10:43 AM
2013-01-04 10:43:23,658 INFO  [org.ovirt.engine.core.bll.storage.SetStoragePoolStatusCommand] (QuartzScheduler_Worker-15) Running command: SetStoragePoolStatusCommand internal: true. Entities affected :  ID: f939bbec-55e5-11e2-be65-00145e6d458c Type: StoragePool
2013-01-04 10:43:23,732 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (QuartzScheduler_Worker-15) AuditLogType: UNASSIGNED not exist in string table
2013-01-04 10:43:23,735 WARN  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (QuartzScheduler_Worker-15) AuditLogType: USER_UPDATE_VM_CLUSTER_DEFAULT_HOST_CLEARED not have severity. Assumed Normal
2013-01-04 10:43:23,735 WARN  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (QuartzScheduler_Worker-15) AuditLogType: USER_REMOVE_VM_TEMPLATE_FINISHED not have severity. Assumed Normal
2013-01-04 10:43:23,735 WARN  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (QuartzScheduler_Worker-15) AuditLogType: VM_IMPORT_INFO not have severity. Assumed Normal
2013-01-04 10:43:23,735 WARN  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (QuartzScheduler_Worker-15) AuditLogType: SYSTEM_UPDATE_VDS_GROUP not have severity. Assumed Normal
2013-01-04 10:43:23,735 WARN  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (QuartzScheduler_Worker-15) AuditLogType: SYSTEM_UPDATE_VDS_GROUP_FAILED not have severity. Assumed Normal
2013-01-04 10:43:23,736 WARN  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (QuartzScheduler_Worker-15) AuditLogType: SYSTEM_CHANGE_STORAGE_POOL_STATUS_RESET_IRS not have severity. Assumed Normal
2013-01-04 10:45:35,302 ERROR [org.ovirt.engine.core.bll.LoginAdminUserCommand] (http-0.0.0.0-8443-1) USER_FAILED_TO_AUTHENTICATE : admin
2013-01-04 10:45:35,303 WARN  [org.ovirt.engine.core.bll.LoginAdminUserCommand] (http-0.0.0.0-8443-1) CanDoAction of action LoginAdminUser failed. Reasons:USER_FAILED_TO_AUTHENTICATE
 

 

 

Save log files, follow the instructions

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3.0/html/Administration_Guide/Administration_Guide-BU_Man_Configs.html

But in the original host from which you save config file is missing /usr/share/rhevm/kerberos/krb5.conf

Does this happen with admin@internal or only with users from AD/IP?

 

If the latter, can u just "rhevm-manage-domains -action=delete" and then add the domain again?

Only admin@internal

on the rhev-m host:

rhevm-config -s AdminPassword=myNewPass

service jbossas restart

 

Login to the admin portal using admin@internal/myNewPass

huh. I changed the password and logged. In the console rhev-m , i saw two domain default with statuses - not respond, not initialised )

One domain contains the inactive hosts in the cluster, the other was empty. The reason - an incorrect description of the database backup and recovery documentation - http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3.0/html/Administration_Guide/Administration_Guide-Backing_Up.html

I changed the method of backup and restore databases.

 

Here is a working procedure for backing up and restoring databases and config files:

1. in rhev-m host backup config files

 

/etc/jbossas/jbossas.conf

/etc/rhevm/

/etc/yum/pluginconf.d/versionlock.list

/etc/pki/rhevm/

/etc/jbossas/rhevm-slimmed/

/usr/share/rhevm/kerberos/krb5.conf

/usr/share/rhevm/rhevm.ear/rhevmanager.war/ExternalConfig.txt

/usr/share/rhevm/rhevm.ear/rhevmanager.war/ServerParameters.js

/root/.pgpass

/root/.rnd

 

2. . in rhev-m host backup rhev-m db

pg_dump --format custom --username postgres --file rhevm_db.pgdump rhevm

3. on new host install rhev-m

 

yum install rhevm

 

4. setup rhev-m with the same value used for the original setup.

 

rhevm-setup

service jbossas stop

 

5. restore backup db

 

pg_restore --dbname rhevm --clean --username postgres rhevm_db.pgdump

 

6. restore config files

7. service jbossas start

8. Login

  

Looks like you originally skipped this step: 

 

>4. setup rhev-m with the same value used for the original setup.

>

>rhevm-setup

 

Can you confirm?

Yes. I skipped this step because it is not in the documentation

OK, thanks for bringing this up, I'll take care of the missing information in the docs

Hi Dan,

When this information will be updated in the docs?

Best!

The BZ has been filed, will take the docs team a bit to update the steps and verify they actually work. In the meantime, just insert rhevm-setup and service jbossas stop between steps 6 and 7 in part 15.3 of the Admin Guide