I can't upgrade from 5.10.1 to 6.0

Hello,

I’m trying to upgrate from 5.10.1 to 6.0 with this document Upgrading Single Front-end Deployments — OpenNebula 6.0.4 documentation. In step “Step 6. Update Configuration Files”, I have started to getting errors. If I run “onecfg status”, this is the output:

/usr/share/rubygems/rubygems/dependency.rb:296:in to_specs': Could not find 'json' (>= 2.0) - did find: [json-1.7.7] (Gem::LoadError) from /usr/share/rubygems/rubygems/dependency.rb:307:in to_spec’
from /usr/share/rubygems/rubygems/core_ext/kernel_gem.rb:47:in gem' from /bin/onecfg:49:in

System runs a CentOS-7.8.2003 and json version package is rubygem-json-1.7.7-36.el7.x86_64. YUM doesn’t get any update for this package.

What can I do now?

Thanks.

Thanks.

Hello @Daniel_Ruiz_Molina,

looks like your environment still doesn’t use the Ruby gems bundled with the OpenNebula and you need to

  1. run /usr/share/one/install_gems to install Ruby dependencies system-wide,
  2. OR switch your environment to use bundled Ruby gems by creating a symlink:
    ln -s /usr/share/one/gems-dist /usr/share/one/gems

Please note the fully-featured onecfg is only part of Enterprise Edition, in Community Edition there is no onecfg status subcommand.

Best,
Vlastimil

1 Like

Hello Vlastimil,

I’m using Ruby gems bundled with Opennebula because my system has the “soft-link” from /usr/share/one/gems-dist to /usr/share/one/gems as you could see below:

[root@mysystem one]# pwd
/usr/share/one
[root@mysystem one]# ls -lhart
total 40K
drwxr-xr-x. 142 root root 4,0K abr 11  2018 ..
-rw-r--r--    1 root root 3,2K dic 10  2019 Gemfile.lock
drwxr-xr-x    7 root root   80 dic 10  2019 gems-dist
-rw-r--r--    1 root root 1,5K dic 10  2019 onetoken.sh
-rwxr-xr-x    1 root root  16K dic 10  2019 install_gems
-rw-r--r--    1 root root 2,5K dic 10  2019 Gemfile
-rwxr-xr-x    1 root root  509 dic 10  2019 follower_cleanup
drwxr-xr-x    2 root root   42 feb  5  2020 esx-fw-vnc
drwxr-xr-x    5 root root  117 feb  5  2020 examples
drwxr-xr-x    3 root root   35 feb  5  2020 websockify
lrwxrwxrwx    1 root root    9 feb 18  2020 gems -> gems-dist
drwxr-xr-x    6 root root  185 feb 18  2020 .

Now, I have read in Upgrading Single Front-end Deployments — OpenNebula 6.0.0 documentation these lines:

Important

When **upgrading** an existing deployment which could be running OpenNebula older than 5.10.0 anytime in the past, you might need to upgrade also required Ruby dependencies with script `install_gems` if you are not yet using the shipped Ruby gems (i.e., when symbolic link `/usr/share/one/gems` doesn’t exist on your Front-end)!

Thanks.

Hello, after reading step-by-step this procedure Upgrading Single Front-end Deployments — OpenNebula 6.0.4 documentation, at step 7 (Upgrade the Database Version), when I run “onedb upgrade -v”, I receive these errors:
[oneadmin@localhost ~]$ onedb upgrade -v
Version read:
Shared tables 5.10.0 : OpenNebula 5.10.1 (45f6d6df) daemon bootstrap
Local tables 5.10.0 : OpenNebula 5.10.1 (45f6d6df) daemon bootstrap

Sqlite database backup stored in /var/lib/one/one.db_2021-4-14_15:59:13.bck
Use 'onedb restore' to restore the DB.

>>> Running migrators for shared tables
Database already uses version 5.10.0

>>> Running migrators for local tables
Database already uses version 5.10.0

Total time: 0.12s
ERROR: Database upgrade to the latest versions (local 5.10.0, shared 5.10.0)
wasn't successful due to missing migration descriptors. Migrators are
provided as part of Enterprise Edition for customers with active subscription.
For community with non-commercial deployments they are provided via a
dedicated migration package, which must be obtained separately.

The database will be restored
Sqlite database backup restored in /var/lib/one/one.db

Step 7 says:

Step 7. Upgrade the Database Version

Important

Users of the Community Edition of OpenNebula can upgrade from the previous stable version if they are running a non-commercial OpenNebula cloud. In order to access the migrator package a request needs to be made through this [online form](https://opennebula.io/get-migration).

Make sure at this point that OpenNebula is not running. If you installed from packages, the service may have been started automatically. Simply run the `onedb upgrade -v` command. The connection parameters are automatically retrieved from `oned.conf` .

What can I do now? My only purpose is updating from 5.10.1 to 6.0. Now, because of I have followed Upgrading Single Front-end Deployments — OpenNebula 6.0.4 documentation from step 1 to 6, my system has upgraded OpenNebula RPMs from version 5.10.1 to 6.0

[root@localhost ~]# rpm -qa | grep opennebula
opennebula-common-onecfg-6.0.0-1.ce.el7.noarch
opennebula-flow-6.0.0-1.ce.el7.noarch
opennebula-rubygems-6.0.0-1.ce.el7.x86_64
opennebula-libs-6.0.0-1.ce.el7.noarch
opennebula-gate-6.0.0-1.ce.el7.noarch
opennebula-migration-community-6.0.0-2.ee.el7.noarch
opennebula-common-6.0.0-1.ce.el7.noarch
opennebula-node-kvm-6.0.0-1.ce.el7.noarch
opennebula-tools-6.0.0-1.ce.el7.noarch
opennebula-provision-6.0.0-1.ce.el7.noarch
opennebula-6.0.0-1.ce.el7.x86_64
opennebula-provision-data-6.0.0-1.ce.el7.noarch
opennebula-sunstone-6.0.0-1.ce.el7.noarch

Also, I have updated “gems”, but I can’t upgrade sqlite database…

[root@localhost yum.repos.d]# /usr/share/one/install_gems

  • Install Build Dependencies for redhat
  • Install Gem Dependencies
    Successfully done!

I have downloaded opennebula-migration-community-6.0.0.zip, uncompressed and installed RPM from “centos7” folder… but I can continue the upgrade process…

Thanks.

Hello,

unfortunately, there might a misunderstanding when asking for migrators. The migrators are provided for previous to latest version (i.e., from 5.12 to 6.0). Obviously, you have skipped upgrade to intermediate version 5.12, for which you need migrators as well.

Since final 5.12.0.4 CE release with full migrators is close and it will have all migrators, you can already take them from git and put on your front-end. This way you will have all intermediate migrators + opennebula-migration-community to migrate from 5.12 to 6.0. See:

  • Files from https://github.com/OpenNebula/one/tree/one-5.12/src/onedb/local/ put into /usr/lib/one/ruby/onedb/local
  • Files from https://github.com/OpenNebula/one/tree/one-5.12/src/onedb/shared put into /usr/lib/one/ruby/onedb/shared

And, once again proceeed with database migration.

Best,
Vlastimil

Excuse me about my simple question… but… how can I download all files? one by one? how? there are not download button, only “raw” that allows me do a “copy-paste”… but is there any way for downloading all files?

On GitHub, you can download ZIP archive of 5.12 branch:
https://github.com/OpenNebula/one/archive/refs/heads/one-5.12.zip

Extract and copy relevant files/directories.

Best,
Vlastimil

Hi,

after copying that files in “local” and “shared” folders, I have rerun upgrade process… but errors remain:
[root@localhost ~]# onedb upgrade -v
Version read:
Shared tables 5.10.0 : OpenNebula 5.10.1 (45f6d6df) daemon bootstrap
Local tables 5.10.0 : OpenNebula 5.10.1 (45f6d6df) daemon bootstrap

Sqlite database backup stored in /var/lib/one/one.db_2021-4-21_12:10:40.bck
Use 'onedb restore' to restore the DB.

>>> Running migrators for shared tables
  > Running migrator /usr/lib/one/ruby/onedb/shared/5.10.0_to_5.12.0.rb
  > Done in 0.02s

Database migrated from 5.10.0 to 5.12.0 (OpenNebula 5.12.0) by onedb command.

>>> Running migrators for local tables
  > Running migrator /usr/lib/one/ruby/onedb/local/5.10.0_to_5.12.0.rb
All custom_attrs will be used as networks
  > Done in 0.20s

Database migrated from 5.10.0 to 5.12.0 (OpenNebula 5.12.0) by onedb command.

Total time: 0.28s
ERROR: Database upgrade to the latest versions (local 5.12.0, shared 5.12.0)
wasn't successful due to missing migration descriptors. Migrators are
provided as part of Enterprise Edition for customers with active subscription.
For community with non-commercial deployments they are provided via a
dedicated migration package, which must be obtained separately.

The database will be restored
Sqlite database backup restored in /var/lib/one/one.db

Now, it seems process detects original version (5.10.0, really, 5.10.1) and future version (5.12.0… but really 6.0…), but ends with error and “database will be restored”.

Now, my system has installed all OpenNebula-6.0 RPMs (step 5).

Help, please.

Thanks.

Hello @Daniel_Ruiz_Molina ,

I’m very sorry for confusion, I didn’t realize the types of migrators can’t be mixed. So, you need first to upgrade OpenNebula to 5.12 (use a recently released 5.12.0.4 CE which already contains migrators to 5.12) and migrate the database. After that, upgrade to 6.0 (and install additional community migrators from 5.12 to 6.0) and upgrade the database from 5.12 to 6.0.

You should better remove any migrators added manualy into /usr/lib/one/ruby/onedb/ from GitHub not to confuse onedb tool.

(Obivously, you can use a different machine with 5.12.0.4 CE to do a database migration only; just place there /var/lib/one/one.db from your current machine and after upgrade, copy it back to your current which might already have 6.0).

I’m sorry for confusion.

Best,
Vlastimil

Hi, good to know that I can’t upgrade from 5.10 to 6.0, because I have been trying to upgrade for few hours.

Previously I’ve successfully upgraded from 5.12 to 6.0. It was few months ago on different machine so I needed to install opennebula again. I installed 6.0 and tried to remove it in order to install 5.12. I tried with apt get purge --auto-remove opennebula, but when after that I installed 5.12, a saw errors

The following packages have unmet dependencies:
 opennebula : PreDepends: opennebula-common-onescape (= 5.12.0.4-1.ce) but it is not going to be installed
              Depends: opennebula-common (= 5.12.0.4-1.ce) but 6.0.0-1.ce is to be installed
              Depends: opennebula-tools (= 5.12.0.4-1.ce) but it is not going to be installed
              Depends: ruby-opennebula (= 5.12.0.4-1.ce) but it is not going to be installed
              Depends: opennebula-rubygems (= 5.12.0.4-1.ce) but 6.0.0-1.ce is to be installed
 opennebula-flow : Conflicts: opennebula (< 6.0.0-1.ce) but 5.12.0.4-1.ce is to be installed
 opennebula-gate : Conflicts: opennebula (< 6.0.0-1.ce) but 5.12.0.4-1.ce is to be installed
 opennebula-libs : Breaks: opennebula (< 5.13.80) but 5.12.0.4-1.ce is to be installed
 opennebula-rubygems : Conflicts: opennebula (< 6.0.0-1.ce) but 5.12.0.4-1.ce is to be installed
 opennebula-sunstone : PreDepends: opennebula-common-onescape (= 5.12.0.4-1.ce) but it is not going to be installed
                       Depends: opennebula-common (= 5.12.0.4-1.ce) but 6.0.0-1.ce is to be installed
                       Depends: ruby-opennebula (= 5.12.0.4-1.ce) but it is not going to be installed
                       Depends: opennebula-tools (= 5.12.0.4-1.ce) but it is not going to be installed
                       Depends: opennebula-rubygems (= 5.12.0.4-1.ce) but 6.0.0-1.ce is to be installed

So, how can I remove opennebula properly? which directories I have to remove? I am facing problems all the time.