Bug #843

onevm shutdown command does not work with KVM in RC1 on Debian Squeeze

Added by Jochem Ippers almost 10 years ago. Updated over 9 years ago.

Status:ClosedStart date:09/28/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:CLI
Target version:Release 3.2 - Beta1
Resolution:worksforme Pull request:
Affected Versions:OpenNebula 3.0

Description

Hi,
the "onevm shutdown VM_ID" command doesn't work on my Debian 6.0 installation with RC1, Hypervisor is KVM.

Excerpt from the VM-Log:

Wed Sep 28 22:30:31 2011 [LCM][I]: New VM state is SHUTDOWN
Wed Sep 28 22:35:36 2011 [VMM][I]: Command execution fail: 'if [ -x "/var/tmp/one/vmm/kvm/shutdown" ]; then /var/tmp/one/vmm/kvm/shutdown one-21 atlas1 21 atlas1; else                              exit 42; fi'
Wed Sep 28 22:35:36 2011 [VMM][E]: Timeout reached and VM one-21 is still alive
Wed Sep 28 22:35:36 2011 [VMM][I]: Timeout reached
Wed Sep 28 22:35:36 2011 [VMM][I]: ExitCode: 1
Wed Sep 28 22:35:36 2011 [VMM][E]: Error shuting down VM: Timeout reached and VM one-21 is still alive
Wed Sep 28 22:35:36 2011 [LCM][I]: Fail to shutdown VM. Assuming that the VM is still RUNNING (will poll VM).
Wed Sep 28 22:35:36 2011 [VMM][I]: ExitCode: 0

Output of "onevm show 21":

VIRTUAL MACHINE 21 INFORMATION                                                  
ID                  : 21                  
NAME                : one-21              
USER                : oneadmin            
GROUP               : oneadmin            
STATE               : ACTIVE              
LCM_STATE           : RUNNING             
HOSTNAME            : atlas1              
START TIME          : 09/28 20:42:48      
END TIME            : 09/28 22:13:40      
DEPLOY ID           : one-21              

VIRTUAL MACHINE MONITORING                                                      
NET_TX              : 63761               
NET_RX              : 3700240             
USED MEMORY         : 2097152             
USED CPU            : 0                   

VIRTUAL MACHINE TEMPLATE                                                        
CPU=1
DISK=[
  BUS=scsi,
  DISK_ID=0,
  READONLY=no,
  SOURCE=/var/lib/one/images/opensuse11.4.img,
  TARGET=sda,
  TYPE=disk ]
ERROR=[
  MESSAGE="Error excuting image transfer script: Could not copy atlas1:/var/lib/one/21/images to atlas1:/var/lib/one//21/images",
  TIMESTAMP="Wed Sep 28 22:13:38 2011" ]
ERROR=[
  MESSAGE="Error shuting down VM: Timeout reached and VM one-21 is still alive",
  TIMESTAMP="Wed Sep 28 22:25:44 2011" ]
ERROR=[
  MESSAGE="Error shuting down VM: Timeout reached and VM one-21 is still alive",
  TIMESTAMP="Wed Sep 28 22:35:36 2011" ]
FEATURES=[
  ACPI=yes ]
MEMORY=2048
NAME=one-21
OS=[
  ARCH=x86_64,
  BOOT=hd,
  INITRD=/initrd.img,
  KERNEL=/vmlinuz,
  ROOT=sda2 ]
REQUIREMENTS="NAME = \"atlas1\"" 
TEMPLATE_ID=0
VMID=21

VIRTUAL MACHINE HISTORY                                                         
 SEQ        HOSTNAME REASON           START        TIME       PTIME
   0          atlas1   user  09/28 20:42:53 00 00:10:34 00 00:00:41
   1          atlas2   stop  09/28 20:53:20 00 01:13:28 00 00:06:34
   2          atlas1   erro  09/28 22:12:53 00 00:00:47 00 00:00:47
   3          atlas1   none  09/28 22:15:23 00 00:58:14 00 00:00:41

acpid is turned on in the guest also.

I will put the "image transfer error" in another ticket.

History

#1 Updated by Javi Fontan almost 10 years ago

It seems that your VM takes a lot on shutting down. Can you check using VNC the shutdown sequence, maybe it gets stuck in some init script. You can also modify the timeout to a bigger value changing /var/lib/one/remotes/vmm/kvm/shutdown. TIMEOUT holds the time in seconds it will wait for the VM to die. After changing this file execute onehost sync so the action script is actualized in the nodes.

#2 Updated by Jochem Ippers almost 10 years ago

Hi Javi!
The VM is rather fast. The libvirt package (including the virsh that is called by the shutdown script) of debian 6.0 seems to be the problem. virsh doesn't work either if you connect directly to the hypervisor with it:

virsh # list
 Id Name                 State
----------------------------------
 12 one-27               running

virsh # reboot 12
error: Failed to reboot domain 12
error: this function is not supported by the connection driver: virDomainReboot

If you try to shutdown a VM with it virsh returns without complaining but nothing happens at all, the VM doesn't get touched in any way.

I will still try a newer libvirt package and comment on it again.

#3 Updated by Ruben S. Montero almost 10 years ago

  • Status changed from New to 4

#4 Updated by Ruben S. Montero almost 10 years ago

  • Target version deleted (Release 3.0)

#5 Updated by Ruben S. Montero almost 10 years ago

  • Status changed from 4 to New

#6 Updated by Jochem Ippers over 9 years ago

Hi,
I'm sorry but I changed to opensuse 11.4 and didn't have the time to test more on Debian. But I had a similar problem with opensuse, it was an acpi-problem of the opensuse os that kept the opensuse VMs from shutting down completely. So maybe it's also an acpi-problem with the Debian release.

Kind regards.
Jochem

#7 Updated by Ruben S. Montero over 9 years ago

  • Status changed from New to Closed
  • Target version set to Release 3.2 - Beta1
  • Resolution set to worksforme

OK, so it seems that this is probably because some misconfiguration or incompatibility between the OS-acpid and the hypervisor. OpenNebula seems to be working as expected so I am closing this with 'worksforme'. We'll reopen this one if needed...

Thanks Jochem for the feedback!

Also available in: Atom PDF