onevm shutdown does not work

For few days I was struggling with making “onevm shutdown” command works in OpenNebula3.4.

It is a bug in OpenNebula or KVM I believe and  specifically happens when we have combination of:

Ubuntu+KVM+Openebula.

Anway, I could not solve it 😦 and therefore resorted to a kind of hack! In fact, I replaced the command with with “onevm cancel”  which is similar to shutdown (although it is not the same!) but it worked for me!

Particularly, I debugged Haizea with replacing

return self.vm_action(“shutdown”, vid)

In haizea/common/opennebula_xmlrpc.py with:

return self.vm_action(“cancel”, vid)

 i wish it will also work for you.
Advertisements

get_migration_bandwidth error in Haizea

I found another bug in Haizea when it works with OpenNebula 3.4.

If you get the following error message in Haizea log file:

“Message: ‘OpenNebulaResourcePoolInfo’ object has no attribute ‘get_migration_bandwidth'”

Then you can fix it as follows:

  • Copy the following piece of code:

def get_migration_bandwidth(self):
  return get_config().get(“imagetransfer-bandwidth”)

  • Open the Opennbula.py module (src/haizea/core/enact/Opennbula.py)
  • Find “OpenNebulaResourcePoolInfo” class
  • paste the above code as a method of this class.
  • Install the Haizea again and it will work.

Debugging Haizea 1.1 to connect Opennebula 3.4

Tags

,

Today I found out a bug in connecting Haizea 1.1 and Opennebula.

I was getting this error in Haizea.log file:

” Enactment of end VM failed: Error when invoking ‘vm.shutdown’: unpack list of wrong size

Enactment error when shutting down VMs.”

In fact, the problem is that the Opennebula RPC interface has changed.

To fix the bug:

  1. Find opennebula_xmlrpc.py file in common directory in Haizea project.
  2. Within this file, search for

(rc, value) = self.rpc.one.vm.action(self.auth2, action, vid)

and change it to the following form:

(f,rc, value) = self.rpc.one.vm.action(self.auth2, action, vid)

** I have also uploaded the modified file. You can download it from here and replace it with the one in your project.

Adapting Haizea to Opennebula 3.4

Tags

, ,

Recently, I tried to use Haizea scheduler along with Opennebula 3.4. However, I faced some bigs  in doing that. I debugged the Haizea code to work properly with Opennebula 3.4.

To fix the bug, do the following:

  1. Download the attached python file:

https://docs.google.com/open?id=0B-fMIDSRxJ_4YkRFZ1FRcEk0dFk

  1. Replace the file with file in Haizea/src/haizea/common/opennebula_xmlrpc.py
  2. Reinstall Haizea.

Now, it works fine…

Lessons learned from installing OpenNebula 3.4 in Ubuntu from source code

Tags

Recently, I installed ONE 3.4 from source code on my Ubuntu 10.4 operating system. It was quite difficult because there were no concrete documents on that. We learned some points and lessons that  are shared here.

Follow instructions based on the documentation (http://opennebula.org/documentation:rel3.4:compile).

  • Try to install in “system wide” mode instead of “self-contained”. We found out that compiling in self-contained mode results in some other problems.
  • be careful to install:

./install -u oneadmin -g oneadmin

  • after running ./install the “one start” fails!
    • Solution:
      • change to root: sudo su
      • mkdir .one
      • echo “oneadmin:password” > ~/.one/one_auth
  • now you can start opennebula: one start

———————————–

  • For configuring KVM in Ubuntu, you need to change libvirt-qemu file. this file is in the following path (that mentioned in ONE documentation is a wrong path):

/etc/apparmor.d/abstractions/libvirt-qemu

  • how to add local host:

onehost add

——————————-

error: unable to connect to ‘/var/run/libvirt/libvirt-sock’: Connection refused

error: failed to connect to the hypervisor


Solution:

  • sudo service libvirt-bin stop

  • sudo service libvirt-bin start

    ——————————–

    We had problem in running ONE 3.4 in the last step. In fact, the VM was failing right after booting with the following message.

    libvir: QEMU error : cannot set ownership on /vmlinuz: Permission denied

    To fix that we did these steps:

    1. stay in oneadmin user

    2. sudo vim /etc/libvirt/qemu.conf

    3. change user = “root” and group=”root”

    4. sudo service libvirt-bin stop

    5. sudo service libvirt-bin start

    6. one start

    7. onetemplate instantiate TEMPLATE ID

      NOTE:

      You can find good instructions on how to fire VMs after installing Opennebula3.4 here:

      http://opennebula.org/documentation:rel3.4:vm_guide

      ——————————————-

debugging gridbus broker

Tags

I just found a bug in installing Gridbus Broker. To remove this bug do the following:

  1. open file lib/Broker.hibernate.cfg.xml
  2. comment this part:

<!–<mapping resource=”org/gridbus/broker/services/compute/alchemi/AlchemiComputeServer.hbm.xml” />
<mapping resource=”org/gridbus/broker/services/compute/globus/GlobusComputeServer.hbm.xml” />
<mapping resource=”org/gridbus/broker/services/compute/globus/gt4/GT4ComputeServer.hbm.xml” />
<mapping resource=”org/gridbus/broker/services/compute/unicore/UnicoreComputeServer.hbm.xml” />
<mapping resource=”org/gridbus/broker/services/compute/apac/gt2/APACGT2ComputeServer.hbm.xml” />
<mapping resource=”org/gridbus/broker/services/compute/apac/gt4/APACGT4ComputeServer.hbm.xml” />–>

Now you can continue installing and using Gridbus Broker.