<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="GtkHTML/4.4.4">
</head>
<body>
OK guys, here it is. The entire process of going from oVirt-3.1 on Fedora to oVirt-3.2 on CentOS!<br>
<br>
<u>Installation</u><br>
minimal Fedora 17 / oVirt-3.1<br>
<br>
<u>Engine Contents</u><br>
NewDC (NFS DataCenter Type, Quota disabled)<br>
- Networks<br>
- ovirtmgmt<br>
- ovirtnfs<br>
- Storage<br>
- Data<br>
- Export<br>
- ISO<br>
- Templates<br>
- CentOS<br>
- Fedora<br>
- Ubuntu<br>
- Clusters (Conroe Family)<br>
- CLusterName<br>
- Hostname1 (No power manangement)<br>
- Hostname2 (No power manangement)<br>
- Virtual machines<br>
- CentOS (Server,AD\abcd0001: UserRole)<br>
- ClonedFedora (Server)<br>
- ClonedUbuntu (Desktop)<br>
- Fedora (Server,AD\abcd0002: UserRole)<br>
- TestPool-{1,2,3} (VDI,Based on Fedora-template)<br>
- Ubuntu (Server,AD\abcd0003: UserRole)<br>
- Windows7 (Server,AD\abcd0004: UserRole)<br>
- Templates<br>
- CentOS<br>
- Fedora<br>
- Ubuntu<br>
- Pools<br>
- TestPool (Assigned:3, Running:1,AD\oVirt_Users:UserRole)<br>
- Permissions<br>
- Active Directory connected<br>
- AD\oVirt_Admins = SuperUser<br>
<br>
1) Back up using "/mnt/backup/ovirtctl":<br>
#!/bin/sh<br>
<br>
DB_EXPORT_PATH=/usr/share/ovirt-engine/db-backups<br>
DB_BKUP_FILENAME=dump_engine_`date "+%Y%m%d_%H%M"`.sql<br>
DB_NAME=engine<br>
ENGINE_CONF='/etc/ovirt-engine<br>
/etc/pki/ovirt-engine<br>
/usr/share/ovirt-engine/db-backups<br>
/root/.pgpass<br>
/root/.rnd'<br>
BACKUPDIR=/mnt/backup<br>
ENGINE_BKUP_FILENAME=bkup_engine_`date "+%Y%m%d_%H%M"`.tgz<br>
<br>
case $1 in<br>
<br>
backup)<br>
find $DB_EXPORT_PATH -mtime +1 -type f -exec rm -rf {} \;<br>
find $BACKUPDIR -mtime +7 -type f -exec rm -rf {} \;<br>
pg_dump -C -E UTF8 --column-inserts --disable-dollar-quoting --disable-triggers -U postgres --format=p -f \<br>
$DB_EXPORT_PATH/$DB_BKUP_FILENAME $DB_NAME<br>
tar zcf $BACKUPDIR/$ENGINE_BKUP_FILENAME $ENGINE_CONF<br>
;;<br>
<br>
#restore)<br>
# tar zxf $BACKUPDIR/$ENGINE_BKUP_FILENAME -C /<br>
#;;<br>
<br>
esac<br>
<br>
# /mnt/backup/ovirtctl backup<br>
# systemctl stop ovirt-engine.service<br>
<br>
2) I chose to install with engine as ISO-provider, so back that up:<br>
# cp -rf /mnt/ISO /mnt/backup/<br>
# cp /etc/exports /mnt/backup/<br>
<br>
3) Reinstall minimal CentOS-6.4<br>
<br>
4) Use dreyou´s guide for setting up engine and re-enter the same password and options as you used when you first installed the engine back in Fedora. Then, after the engine has started, shut it down and begin restoring the previous setup:<br>
<a href="http://wiki.dreyou.org/dokuwiki/doku.php?id=ovirt_rpm_start31">http://wiki.dreyou.org/dokuwiki/doku.php?id=ovirt_rpm_start31</a><br>
<br>
# service ovirt-engine stop<br>
# service jboss-as stop<br>
# service httpd stop<br>
<br>
5) Start the restoring process (make sure to mount your backup).<br>
- Restore ISO domain<br>
# rm -rf /mnt/ISO/*<br>
# cp -rf /mnt/backup/ISO/* /mnt/ISO/<br>
# cp /mnt/backup/exports /etc/exports<br>
# chown -R 36:36 /mnt/ISO/<br>
# service nfs restart<br>
<br>
- Restore engine<br>
# tar zxf $BACKUPDIR/$ENGINE_BKUP_FILENAME -C /<br>
<br>
- Make a minor modification to the backed up Fedora database dump:<br>
@@ -4,9 +4,10 @@<br>
<br>
SET statement_timeout = 0;<br>
SET client_encoding = 'UTF8';<br>
-SET standard_conforming_strings = on;<br>
+SET standard_conforming_strings = off;<br>
SET check_function_bodies = false;<br>
SET client_min_messages = warning;<br>
+SET escape_string_warning = off;<br>
<br>
--<br>
-- Name: engine; Type: DATABASE; Schema: -; Owner: engine<br>
@@ -21,36 +22,18 @@<br>
<br>
SET statement_timeout = 0;<br>
SET client_encoding = 'UTF8';<br>
-SET standard_conforming_strings = on;<br>
+SET standard_conforming_strings = off;<br>
SET check_function_bodies = false;<br>
SET client_min_messages = warning;<br>
+SET escape_string_warning = off;<br>
<br>
--<br>
--- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:<br>
+-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: engine<br>
--<br>
<br>
-CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;<br>
+CREATE PROCEDURAL LANGUAGE plpgsql;<br>
<br>
<br>
---<br>
--- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:<br>
---<br>
-<br>
-COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';<br>
-<br>
-<br>
---<br>
--- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner:<br>
---<br>
-<br>
-CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;<br>
-<br>
-<br>
---<br>
--- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner:<br>
---<br>
-<br>
-COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';<br>
-<br>
+ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO engine;<br>
<br>
SET search_path = public, pg_catalog;<br>
<br>
- Restore database from backup:<br>
# dropdb -U postgres engine<br>
# createdb -U postgres engine<br>
# psql -U postgres engine < /usr/share/ovirt-engine/db-backups/dump_engine_20130805_1137.sql<br>
# service httpd start<br>
# service jboss-as start<br>
# service ovirt-engine start<br>
<br>
5) After everything is back up and running in CentOS, you follow dreyou´s guide on upgrading from 3.1 to 3.2:<br>
<a href="http://wiki.dreyou.org/dokuwiki/doku.php?id=ovirt_rpm_update31to32">http://wiki.dreyou.org/dokuwiki/doku.php?id=ovirt_rpm_update31to32</a><br>
<br>
- For me, as several others, engine-upgrade first fails because you have to run it like:<br>
# LC_ALL=C engine-upgrade<br>
<br>
- And here was the trickiest part of the entire process, I had to actually fail once to be able to save a modified version of "/usr/share/ovirt-engine/dbscripts/upgrade/03_01_1520_add_fk_vm_interface_vm_static_template.sql" and insert:<br>
<b>DELETE FROM vm_interface where vmt_guid not in (SELECT vm_guid FROM vm_static);</b><br>
select fn_db_create_constraint('vm_interface', 'FK_vm_interface_vm_static_template', 'FOREIGN KEY(vmt_guid)<br>
REFERENCES vm_static(vm_guid) ON DELETE CASCADE');<br>
<br>
on the first line, which is reported in BZ 890179. Then I had to have three SSH terminals running at the same time; one where I executed "LC_ALL=C engine-upgrade", another tailing the upgrade log, and a third where I had "cp -f 03_01_1520_add_fk_vm_interface_vm_static_template.sql.bak
03_01_1520_add_fk_vm_interface_vm_static_template.sql" waiting in dir "/usr/share/ovirt-engine/dbscripts/upgrade". When tailing the log, I looked for the exact moment when ovirt-engine-dbscripts was installed, then faster than a speeding bullet flipped over
to the third terminal where I had the cp-command waiting and overwrote the dbscripts upgrade file with the patched version. The database upgrade process then completed and I was up in oVirt-3.2 with CentOS.<br>
It would be really nice if that could be fixed in the future so that other people don´t have to resort to the same rpm-violence as I did to get their version upgraded:)<br>
<br>
6) Since the engine was moved from Fedora to CentOS, I noticed that this was required to be able to boot any machines after the switch:<br>
# engine-config -s EmulatedMachine=pc --cver=3.1<br>
# service ovirt-engine restart<br>
<br>
7) Then it´s just a matter of putting your Hosts into maintenance and reinstall them one by one, either as Fedora-18 or CentOS-6.4, where I opted for the latter. Just FYI, I used dreyou´s repo for the engine, but for the Hosts I chose to use the oVirt repo
when installing, without issues. When all of the Hosts are reinstated into the engine, you first go and select your Cluster(s) and up the compatibility version to 3.2, and then do the same for Data Center(s), and then you´re done!<br>
<br>
I hope to root that the 3.2 -> 3.3 process will be less troublesome than this one was!:)<br>
<br>
/Karli Sjöberg<br>
<br>
sön 2013-08-04 klockan 12:09 +0300 skrev Alex Lourie:
<blockquote type="CITE">
<pre>
On Fri 02 Aug 2013 10:59:16 AM IDT, Karli Sjöberg wrote:
> tor 2013-08-01 klockan 07:46 -0400 skrev Alex Lourie:
>> @Alon
>>
>> Upgrade from 3.1 to 3.2 doesn't work in upstream, that's why we are doing this.
>>
>> @Karli - are you keeping the keys/certificates from the 3.1 installation?
>>
>
> That time, no I didn´t. By this time, I was rather fed up with Fedora
> so I started thinking outside the box a little. So I reinstalled
> Fedora 17, installed engine and reran engine-setup. After that I made
> a backup, then reinstalled to CentOS-6.4 and used dreyou´s repo to
> regain oVirt-3.1. Then I ran engine-setup, shut the engine down,
> dropped the db, restored the previous db I had when it was Fedora and
> restored /etc/pki/ovirt-engine/certs, /keys, .keystore and
> .truststore. After a restart of httpd and ovirt-engine I was able to
> log in to the 3.1-engine that was originally set up in Fedora. And
> since that worked alright, I proceeded with following dreyou´s
> excellent (because it´s tested) guide for upgrading from 3.1 to 3.2,
> and it worked!!! So the once Fedora/oVirt-3.1 engine is now a
> CentOS/oVirt-3.2 engine instead:)
>
> So as it turns out, the best way of upgrading from oVirt-3.1 on Fedora
> is...to switch to CentOS...
>
> I will rerun the procedure again from start, but this time with added
> Hosts, Storage, etc. to confirm.
>
> --
>
> Med Vänliga Hälsningar
> -------------------------------------------------------------------------------
> Karli Sjöberg
> Swedish University of Agricultural Sciences
> Box 7079 (Visiting Address Kronåsvägen 8)
> S-750 07 Uppsala, Sweden
> Phone: +46-(0)18-67 15 66
> <a href="mailto:karli.sjoberg@slu.se">karli.sjoberg@slu.se</a> <<a href="mailto:karli.sjoberg@adm.slu.se">mailto:karli.sjoberg@adm.slu.se</a>>
>
Hi Karli
Thanks for the effort testing this procedure!
The mileage on CentOS is better as there are less things that change
between 3.1 and 3.2 on CentOS (postgres, for example, stays the same,
iptables do not change to firewalld, etc).
Let us know how it goes with hosts, storage, and other objects in the
DB.
Thanks!
</pre>
</blockquote>
<br>
<table cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>-- <br>
<br>
Med Vänliga Hälsningar<br>
-------------------------------------------------------------------------------<br>
Karli Sjöberg<br>
Swedish University of Agricultural Sciences<br>
Box 7079 (Visiting Address Kronåsvägen 8)<br>
S-750 07 Uppsala, Sweden<br>
Phone: +46-(0)18-67 15 66<br>
<a href="mailto:karli.sjoberg@adm.slu.se">karli.sjoberg@slu.se</a> </td>
</tr>
</tbody>
</table>
</body>
</html>