[Users] Fedora upgrading from 3.1 to 3.2

Karli Sjöberg Karli.Sjoberg at slu.se
Wed Aug 7 07:27:53 EDT 2013


OK guys, here it is. The entire process of going from oVirt-3.1 on Fedora to oVirt-3.2 on CentOS!

Installation
minimal Fedora 17 / oVirt-3.1

Engine Contents
NewDC (NFS DataCenter Type, Quota disabled)
- Networks
  - ovirtmgmt
  - ovirtnfs
- Storage
  - Data
  - Export
  - ISO
- Templates
  - CentOS
  - Fedora
  - Ubuntu
- Clusters (Conroe Family)
   - CLusterName
    - Hostname1 (No power manangement)
    - Hostname2 (No power manangement)
- Virtual machines
  - CentOS (Server,AD\abcd0001: UserRole)
  - ClonedFedora (Server)
  - ClonedUbuntu (Desktop)
  - Fedora (Server,AD\abcd0002: UserRole)
  - TestPool-{1,2,3} (VDI,Based on Fedora-template)
  - Ubuntu (Server,AD\abcd0003: UserRole)
  - Windows7 (Server,AD\abcd0004: UserRole)
- Templates
  - CentOS
  - Fedora
  - Ubuntu
- Pools
  - TestPool (Assigned:3, Running:1,AD\oVirt_Users:UserRole)
- Permissions
  - Active Directory connected
   - AD\oVirt_Admins = SuperUser

1) Back up using "/mnt/backup/ovirtctl":
#!/bin/sh

DB_EXPORT_PATH=/usr/share/ovirt-engine/db-backups
DB_BKUP_FILENAME=dump_engine_`date "+%Y%m%d_%H%M"`.sql
DB_NAME=engine
ENGINE_CONF='/etc/ovirt-engine
             /etc/pki/ovirt-engine
             /usr/share/ovirt-engine/db-backups
             /root/.pgpass
             /root/.rnd'
BACKUPDIR=/mnt/backup
ENGINE_BKUP_FILENAME=bkup_engine_`date "+%Y%m%d_%H%M"`.tgz

case $1 in

  backup)
    find $DB_EXPORT_PATH -mtime +1 -type f -exec rm -rf {} \;
    find $BACKUPDIR -mtime +7 -type f -exec rm -rf {} \;
    pg_dump -C -E UTF8 --column-inserts --disable-dollar-quoting --disable-triggers -U postgres --format=p -f \
    $DB_EXPORT_PATH/$DB_BKUP_FILENAME $DB_NAME
    tar zcf $BACKUPDIR/$ENGINE_BKUP_FILENAME $ENGINE_CONF
  ;;

  #restore)
  #  tar zxf $BACKUPDIR/$ENGINE_BKUP_FILENAME -C /
  #;;

esac

# /mnt/backup/ovirtctl backup
# systemctl stop ovirt-engine.service

2) I chose to install with engine as ISO-provider, so back that up:
# cp -rf /mnt/ISO /mnt/backup/
# cp /etc/exports /mnt/backup/

3) Reinstall minimal CentOS-6.4

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:
http://wiki.dreyou.org/dokuwiki/doku.php?id=ovirt_rpm_start31

# service ovirt-engine stop
# service jboss-as stop
# service httpd stop

5) Start the restoring process (make sure to mount your backup).
- Restore ISO domain
# rm -rf /mnt/ISO/*
# cp -rf /mnt/backup/ISO/* /mnt/ISO/
# cp /mnt/backup/exports /etc/exports
# chown -R 36:36 /mnt/ISO/
# service nfs restart

- Restore engine
# tar zxf $BACKUPDIR/$ENGINE_BKUP_FILENAME -C /

- Make a minor modification to the backed up Fedora database dump:
@@ -4,9 +4,10 @@

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
+SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
+SET escape_string_warning = off;

--
-- Name: engine; Type: DATABASE; Schema: -; Owner: engine
@@ -21,36 +22,18 @@

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
-SET standard_conforming_strings = on;
+SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
+SET escape_string_warning = off;

--
--- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
+-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: engine
--

-CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
+CREATE PROCEDURAL LANGUAGE plpgsql;


---
--- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
---
-
-COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
-
-
---
--- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner:
---
-
-CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;
-
-
---
--- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner:
---
-
-COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';
-
+ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO engine;

SET search_path = public, pg_catalog;

- Restore database from backup:
# dropdb -U postgres engine
# createdb -U postgres engine
# psql -U postgres engine < /usr/share/ovirt-engine/db-backups/dump_engine_20130805_1137.sql
# service httpd start
# service jboss-as start
# service ovirt-engine start

5) After everything is back up and running in CentOS, you follow dreyou´s guide on upgrading from 3.1 to 3.2:
http://wiki.dreyou.org/dokuwiki/doku.php?id=ovirt_rpm_update31to32

- For me, as several others, engine-upgrade first fails because you have to run it like:
# LC_ALL=C engine-upgrade

- 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:
DELETE FROM vm_interface where vmt_guid not in (SELECT vm_guid FROM vm_static);
select fn_db_create_constraint('vm_interface', 'FK_vm_interface_vm_static_template', 'FOREIGN KEY(vmt_guid)
REFERENCES vm_static(vm_guid) ON DELETE CASCADE');

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.
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:)

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:
# engine-config -s EmulatedMachine=pc --cver=3.1
# service ovirt-engine restart

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!

I hope to root that the 3.2 -> 3.3 process will be less troublesome than this one was!:)

/Karli Sjöberg

sön 2013-08-04 klockan 12:09 +0300 skrev Alex Lourie:


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
> karli.sjoberg at slu.se<mailto:karli.sjoberg at slu.se> <mailto:karli.sjoberg at adm.slu.se>
>

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!


--

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
karli.sjoberg at slu.se<mailto:karli.sjoberg at adm.slu.se>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20130807/98860637/attachment-0001.html>


More information about the Users mailing list