Request #415
Migration path from 1.4 to 2.0.1
| Status: | Closed | Start date: | 11/19/2010 | |
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | Ecosystem | |||
| Target version: | - |
Description
As I mentioned on the users list, I'm working on the migration of our 1.4 opennebula infrastructure to the 2.0.1 version.
I have tested the procedure and it seems now good to publish it.
The underlying scripts are strongly customized to our needs, but may be a good start point, and in the most cases a usefull path to migrate from 1.4 to 2.0.1.
If you are using the version 1.2 of one, migrate it first as described on Request #181: http://dev.opennebula.org/issues/181.
History
Updated by Marlon Nerling over 1 year ago
Before you start .. make a backup of you actual opennebula install:
cd /; tar cpvPj -f ~/opennebula.1.4.backup.tbz2 /{etc,usr/lib,} /var/lib/one/{.ssh,one.db} /usr/bin/{one,occi,econe,mm_sched}
Updated by Marlon Nerling over 1 year ago
Marlon Nerling wrote:
Before you start .. make a backup of you actual opennebula install:
cd /; tar cpvPj -f ~/opennebula.1.4.backup.tbz2 /{etc,usr/lib,} /var/lib/one/{.ssh,one.db} /usr/bin/{one,occi,econe,mm_sched}*
Updated by Marlon Nerling over 1 year ago
Now remove opennebula 1.4, download and install the 2.0.1 package - debian has some dependencies problems, stay attempt.
We have own tm_commands, I overwrite the defaults from my backup.
The one.conf has changed, so reconfigure it to your needs.
We are using the mysql database, it makes one much faster. (My scripts produce mysql inserts, you may change it if you will to stay with sqlite3 - I would not!!)
Now start and stop one - it will create the opennebula database:
- one start; sleep 10; one stop
[The next step will create mysql inserts from the one.db]
Updated by Marlon Nerling over 1 year ago
- File one.migration.tbz2 added
Updated by Marlon Nerling over 1 year ago
cd /tmp/; tar xpvPj -f ~/download/one.migration.tbz2 && cd /tmp/one.migration
Now change the defaults on one.migration.common.sh:
- ORIGINAL_DB=/tmp/one.db # the path to your one.db - remember: make a copy of your database!!
- DEBUG=true # if true informs on every db access, will redirect debug from STDOUT to STDERR.
make gts.sh executable.
execute ./gts.sh and pipe STDOUT to a file like /tmp/opennebula.inserts.sql.
Make sure oned is not running!
Open the sql file and read it, I use vim with syntax highlight to help identify broken strings and inconsistent insert code.
Go through, take some time for this, you will not be happy if some vm_pool entries are not inserted!!
If you are sure of the consistence of the sql file:
- mysql -D opennebula;
- source /tmp/opennebula.inserts.sql
(history may have some unique key issues, this is not a problem!)
- Delete /tmp/one* on every host (follow issue http://dev.opennebula.org/issues/385, too).
- start one : $ one start;
- test onevm, onehost, etc.
If all was fine you now have a running opennebula 2.0.1,
else: - stop one
- drop the opennebula database (!!)
- restart from above, something is wrong with vm_pool.template or host_pool.template, or I messed with my scripts and you may search for another migration path.
Updated by Marlon Nerling over 1 year ago
I wish you good look.
I had it.
Best regards
Marlon Nerling
Updated by Marlon Nerling over 1 year ago
The scripts it the one.migration.tbz2 file stay all under the GPLv3 licence.
Headers in distributing should be:
#########
Project: one.migration: Scripts for the migration from opennebula 1.4 to 2.0.1
Description: This bash source file contains functions for the SQL migration.
Author: Marlon Nerling
Copyright: Copyright (C) 2010 Abacus Research AG, 9301 Wittenbach, Schweiz http://www.abacus.ch
@see The GNU Public License (GPL)
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Updated by Marlon Nerling over 1 year ago
Marlon Nerling wrote:
Before you start .. make a backup of you actual opennebula install:
cd /; tar cpvPj -f ~/opennebula.1.4.backup.tbz2 /{etc,usr/lib,}/one /var/lib/one/{.ssh,one.db} /usr/bin/{one,occi,econe,mm_sched}*
Updated by Marlon Nerling over 1 year ago
Marlon Nerling wrote:
Marlon Nerling wrote:
Before you start .. make a backup of you actual opennebula install:
cd /; tar cpvPj -f ~/opennebula.1.4.backup.tbz2 /{etc,usr/lib,} /var/lib/one/{.ssh,one.db} /usr/bin/{one,occi,econe,mm_sched}*
Forget this part.. bad bad tar command... make a backup, you know!!
Updated by Marlon Nerling over 1 year ago
- File gts.sh added
gts.sh on one.migration.tbz2 has harcoded sqlite3 database, use this instead
Updated by Ruben S. Montero over 1 year ago
- Target version deleted (
Release 2.0.1)
Updated by Shi Jin over 1 year ago
I can confirm your scripts worked for me. Thanks a lot.
Updated by Marlon Nerling over 1 year ago
Thanks Shi Jin for you courage ;)
So .. today I take my courage and did the migration.
Somethings had changed on opennebula between the version from 1 Month ago to today, so I had some problems.
I will report every one of them and repost new scripts, stay tuned.
Updated by Marlon Nerling over 1 year ago
Don't use the above scripts under the version 2.0.1-1(Actual download)!!
See Bugs:
VMs created on opennebula_2.0-1 fails to restart under opennebula_2.0.1-1
http://dev.opennebula.org/issues/464
opennebula_2.0.1-1 defaults to incorrect a DISK/DRIVER attribute of the VM
http://dev.opennebula.org/issues/465
Updated by Marlon Nerling over 1 year ago
- File one.migration.2.0.1-1.tbz2 added
If you have 2 disk with diferent formats, try editing one.migration/one.migration.vm.sh to this.. or parse the sql after generation.
I have not will to parse OS/BOOT, FEATURES/ACPI and FEATURES/PAE from 1.4 to 2.0.1, so you may set a default by yourself.
These defaults can be found in the file one.migration/one.migration.common.sh:
(SNIP)
- mandatory defaults
DEFAULT_DISK_DRIVER=qcow2
DEFAULT_ARCH=x86_64
DEFAULT_BOOT=hd - Optional defaults..
DEFAULT_ACPI=yes
DEFAULT_PAE=no
(SNIP)
Use the scripts as descripted above.
Updated by Ruben S. Montero 10 months ago
- Status changed from New to Closed
I am closing this one. OpenNebula 3.0 features DB versioning and update scripts.
Thank you Marlon for contributing this