Feature #1286

Check for OS:ARCH mandatory attribute present in VM template

Added by Olivier Berger about 9 years ago. Updated about 9 years ago.

Status:ClosedStart date:05/22/2012
Priority:NormalDue date:
Assignee:Ruben S. Montero% Done:

0%

Category:Core & System
Target version:Release 3.6
Resolution:worksforme Pull request:

Description

If the OS:ARCH is not specified in the VM template file, with KVM, the default value may cause problems : incompatible architecture with the prepared image.

Please add a check for the presence of this setting instead of fixing a default.

See a more detailed discussion at http://lists.opennebula.org/pipermail/users-opennebula.org/2012-May/008972.html

Thanks in advance

History

#1 Updated by Ruben S. Montero about 9 years ago

  • Category set to Core & System
  • Status changed from New to Closed
  • Assignee set to Ruben S. Montero
  • Target version set to Release 3.8
  • Resolution set to worksforme

While working on the bug, I just realized that the code is ready to work as you described. Just removed or comment the ARCH entry in vmm_exec_kvm.conf. This will fail the deployment if no ARCH is provided (as you do not provide a default for your users).

#2 Updated by Olivier Berger about 9 years ago

Uh, here, it doesn't fail the deployment per se, at least on 3.2.1, tested on my Debian system.

Worse, kvm is started and boot of the VM gets stuck (see Debian bug http://bugs.debian.org/673173).

Is there really a check for this missing mandatory attribute upon KVM deployment ?

#3 Updated by Ruben S. Montero about 9 years ago

Yep, check LibVirtDriverKVM.cc:178

    if ( arch.empty() )
    {
        get_default("OS","ARCH",arch);

        if ( arch.empty() )
        {
            goto error_arch;
        }
    }
....

You should see

"No ARCH defined and no default provided." 

in vm.log.

Please could you check that you have modified the right file?

#4 Updated by Olivier Berger about 9 years ago

OK, the sources for 3.2.1 (that I'm running) indeed seem to contain this check... so maybe I modified the wrong files...

I think that I modified /etc/one/vmm_exec/vmm_exec_kvm.conf to remove the ARCH default... but I'm afraid it's the one used on One manager and not for the One node I'm running on the same host (which would be more something related to /var/tmp/one ?). Maybe the distinction should be clearer between /etc files for One manager and One nodes in the Debian packaging, but that's another story. I'll try again and report.

#5 Updated by Olivier Berger about 9 years ago

OK... well, my mistake. I probably had not restarted One, or some other mistake.

I can now see a FAILED VM whose logs indeed contain the expected "No ARCH defined and no default provided."

Sorry about the bothering.

#6 Updated by Ruben S. Montero about 9 years ago

  • Target version changed from Release 3.8 to Release 3.6

Also available in: Atom PDF