[one-users] issue: VM instance can't shut down through "sunstone" command

GONG YONGJIE A Yongjie.a.Gong at alcatel-sbell.com.cn
Thu Mar 10 17:42:11 PST 2011


Hi Héctor,

	Got it. Thanks very much :)

-----Original Message-----
From: Héctor Sanjuán [mailto:hsanjuan at opennebula.org] 
Sent: Thursday, March 10, 2011 6:49 PM
To: GONG YONGJIE A
Cc: users at lists.opennebula.org
Subject: Re: [one-users] issue: VM instance can't shut down through "sunstone" command

Ok,

My mistake, KVM driver is not plugging the VM off after the timeout
occurs. var/remotes/vmm/kvm/shutdown:

        if [ "$count" -gt "$TIMEOUT" ]
        then
                echo "Timeout reached" >&2
                exit 1
        fi

ttylinux is just ignoring the shutdown signal, so the script fails with
the "Timeout reached" message as expected.

I guess the way to power off ttylinux is either using 'onevm cancel',
modifying the poweroff script so it destroys the VM if the TIMEOUT is
reached or getting the VM to understand the acpi poweroff signal.

Héctor


El 10/03/11 07:36, GONG YONGJIE A escribió:
> Thanks Hector.
> 
> Just try to reproduce it. Status of VM becomes "shutdown" and then is recovered to "running".
> 
> "
> Thu Mar 10 15:23:31 2011 [VMM][E]: Error shuting down VM, Timeout reached
> Thu Mar 10 15:23:31 2011 [LCM][I]: Fail to shutdown VM. Assuming that the VM is still RUNNING (will poll VM).
> "
> 
> [root at cloudmanager images]# cat vm-linux-0.2.conf 
> NAME = linux-0.2 
> MEMORY = 512 
> CPU = 1
> VCPU = 1
> 
> EMULATOR = /usr/libexec/qemu-kvm
> 
> ARCH = i686
> 
> BOOT = hd
> 
> DISK = [ IMAGE= "linux-0.2" ]
> 
> NIC = [ MAC = "05:80:42:03:17:86", MODLE ="e1000", BRIDGE = "br0" ]
> NIC = [ MAC = "05:80:42:03:18:86", MODLE ="e1000", BRIDGE = "br1" ]
> 
> GRAPHICS = [
>         TYPE = "vnc",
>         LISTEN = "127.0.0.1",
>         PORT = "5914" ]
> 
> -----Original Message-----
> From: Héctor Sanjuán [mailto:hsanjuan at opennebula.org] 
> Sent: Wednesday, March 09, 2011 5:08 PM
> To: GONG YONGJIE A
> Cc: users at lists.opennebula.org
> Subject: Re: [one-users] issue: VM instance can't shut down through "sunstone" command
> 
> Hi,
> 
> 
> Shutdown is a transitory state indicating that the shutdown script has
> started. This script tries to send and shutdown ACPI signal to the VM
> and regularly checks if the VM has shut down until the TIMEOUT occurs
> (defined in the shutdown remotes script as far as i know).
> 
> If the VM has not been shutdown after that time, the script will try to
> directly "power off" the VM. After that the VM is deleted [1]
> 
> Does your VM stay in shutdown state indefinitely? If you are using
> ttylinux it might be ignoring the ACPI shutdown signal and therefore it
> would take the TIMEOUT to power it off.
> 
> The stop state is meant to freeze a vm in running state by saving its
> state. Can you ellaborate on how "onevm stop" is failing?
> 
> I hope it helps, if not you can send the full VM log and template.
> 
> Hector
> 
> [1] VM State diagram: http://opennebula.org/documentation:rel2.0:vm_guide
> 
> El 09/03/11 04:58, GONG YONGJIE A escribió:
>> Hi,
>>
>>         I encountered another issue that after shutdown VM instance
>> from"sunstone",the VM is still alive even status of this VM
>> becomes"SHUTDOWN".
>>
>>         Also from"onevm"command, itis failed to use"onevm stop".
>>
>>         [root at cloudmanager one]# onevm list
>>
>>    ID     USER     NAME STAT CPU     MEM        HOSTNAME        TIME
>>
>> 9     root   test-8 shut   2    512M   172.24.178.38 00 00:18:29
>>
>> qemu     30740     1  2 07:35 ?        00:00:24 /usr/libexec/qemu-kvm -S
>> -M rhel6.0.0 -cpu qemu32 -enable-kvm -m 512 -smp
>> 1,sockets=1,cores=1,threads=1 -name one-9 -uuid
>> 064aecf7-a857-222f-8121-5d47facf5eef -nodefconfig -nodefaults -chardev
>> socket,id=monitor,path=/var/lib/libvirt/qemu/one-9.monitor,server,nowait
>> -mon chardev=monitor,mode=control -rtc base=utc -boot c -drive
>> file=/var/lib/one//9/images/disk.0,if=none,id=drive-ide0-0-0,boot=on,format=raw
>> -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0
>> -netdev tap,fd=23,id=hostnet0 -device
>> rtl8139,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,addr=0x3
>> -usb -vnc 127.0.0.1:8 -vga cirrus
>> -devicevirtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
>>
>> [root at cloudmanager one]# cat 9.log
>>
>> ...
>>
>> Wed Mar  9 12:01:55 2011 [LCM][I]: New VM state is SHUTDOWN
>>
>> [root at cloudmanager one]# rpm -qa | grep -i openNebula
>>
>> opennebula-2.1.80-1
>>
>> [root at cloudmanager one]# cat /etc/one/oned.conf
>>
>> #*******************************************************************************
>>
>> #                       OpenNebula Configuration file
>>
>> #*******************************************************************************
>>
>> #*******************************************************************************
>>
>> # Daemon configuration attributes
>>
>> #-------------------------------------------------------------------------------
>>
>> #  MANAGER_TIMER: Time in seconds the core uses to evaluate periodical
>> functions.
>>
>> #  HOST_MONITORING_INTERVAL and VM_POLLING_INTERVAL can not have smaller
>> values
>>
>> #  than MANAGER_TIMER.
>>
>> #
>>
>> #  HOST_MONITORING_INTERVAL: Time in seconds between host monitorization.
>>
>> #
>>
>> #  VM_POLLING_INTERVAL: Time in seconds between virtual machine
>> monitorization.
>>
>> #  (use 0 to disable VM monitoring).
>>
>> #
>>
>> #  VM_DIR: Remote path to store the VM images, it should be shared
>> between all
>>
>> #  the cluster nodes to perform live migrations. This variable is the
>> default
>>
>> #  for all the hosts in the cluster. VM_DIR IS ONLY FORTHE NODES AND
>> *NOT* THE
>>
>> #  FRONT-END
>>
>> #
>>
>> #  SCRIPTS_REMOTE_DIR: Remote path to store the monitoring and VM management
>>
>> #  scripts.
>>
>> #
>>
>> #  PORT: Port where oned will listen for xmlrpc calls.
>>
>> #
>>
>> #  DB: Configuration attributes for the database backend
>>
>> #   backend : can be sqlite or mysql (default is sqlite)
>>
>> #   server  : (mysql) host name or an IP address for the MySQL server
>>
>> #   port    : (mysql) port for the connection to the server.
>>
>> #                     If set to 0, the default port is used.
>>
>> #   user    : (mysql) user's MySQL login ID
>>
>> #   passwd  : (mysql) the password for user
>>
>> #   db_name : (mysql) the database name
>>
>> #
>>
>> #  VNC_BASE_PORT: VNC ports for VMs can be automatically set to
>> VNC_BASE_PORT +
>>
>> #  VMID
>>
>> #
>>
>> #  DEBUG_LEVEL: 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG
>>
>> #*******************************************************************************
>>
>> #MANAGER_TIMER=30
>>
>> HOST_MONITORING_INTERVAL = 20
>>
>> VM_POLLING_INTERVAL      = 10
>>
>> #VM_DIR=/srv/cloud/one/var
>>
>> SCRIPTS_REMOTE_DIR=/var/tmp/one
>>
>> PORT=2633
>>
>> #DB = [ backend = "sqlite" ]
>>
>> # Sample configuration for MySQL
>>
>>  DB = [ backend = "mysql",
>>
>>         server  = "localhost",
>>
>>         port    = 0,
>>
>>         user    = "root",
>>
>>         passwd  = "alcatel",
>>
>>         db_name = "opennebula" ]
>>
>> VNC_BASE_PORT = 5900
>>
>> DEBUG_LEVEL=3
>>
>> #*******************************************************************************
>>
>> # Physical Networks configuration
>>
>> #*******************************************************************************
>>
>> #  NETWORK_SIZE: Here you can define the default size for the virtual
>> networks
>>
>> #
>>
>> #  MAC_PREFIX: Default MAC prefix to be used to create the
>> auto-generated MAC
>>
>> #  addresses is defined here (this can be overrided by the Virtual Network
>>
>> #  template)
>>
>> #*******************************************************************************
>>
>> NETWORK_SIZE = 254
>>
>> MAC_PREFIX   = "08:80:42"
>>
>> #*******************************************************************************
>>
>> # Image Repository Configuration
>>
>> #*******************************************************************************
>>
>> #  IMAGE_REPOSITORY_PATH: Define the path to the image repository, by
>> default
>>
>> #  is set to $ONE_LOCATION/var/images
>>
>> #
>>
>> #  DEFAULT_IMAGE_TYPE: This can take values
>>
>> #       OS        Image file holding an operating system
>>
>> #       CDROM     Image file holding a CDROM
>>
>> #       DATABLOCK Image file holding a datablock,
>>
>> #                 always created as an empty block
>>
>> #  DEFAULT_DEVICE_PREFIX: This can be set to
>>
>> #       hd        IDE prefix
>>
>> #       sd        SCSI
>>
>> #       xvd       XEN Virtual Disk
>>
>> #       vd        KVM virtual disk
>>
>> #*******************************************************************************
>>
>> IMAGE_REPOSITORY_PATH = /srv/cloud/var/images
>>
>> DEFAULT_IMAGE_TYPE    = "OS"
>>
>> DEFAULT_DEVICE_PREFIX = "hd"
>>
>> #*******************************************************************************
>>
>> # Information Driver Configuration
>>
>> #*******************************************************************************
>>
>> # You can add more information managers with different configurations
>> but make
>>
>> # sure it has different names.
>>
>> #
>>
>> #   name      : name for this information manager
>>
>> #
>>
>> #   executable: path of the information driver executable, can be an
>>
>> #               absolute path or relative to $ONE_LOCATION/lib/mads (or
>>
>> #               /usr/lib/one/mads/ if OpenNebula was installed in /)
>>
>> #
>>
>> #   arguments : for the driver executable, usually a probe configuration
>> file,
>>
>> #               can be an absolute path or relative to $ONE_LOCATION/etc (or
>>
>> #               /etc/one/ if OpenNebula was installed in /)
>>
>> #*******************************************************************************
>>
>> #-------------------------------------------------------------------------------
>>
>> #  KVM Information Driver Manager Configuration
>>
>> #    -r number of retries when monitoring a host
>>
>> #    -t number of threads, i.e. number of hosts monitored at the same time
>>
>> #-------------------------------------------------------------------------------
>>
>> IM_MAD = [
>>
>>       name       = "im_kvm",
>>
>>       executable = "one_im_ssh",
>>
>>       arguments  = "-r 0 -t 15 kvm" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #-------------------------------------------------------------------------------
>>
>> #  XEN Information Driver Manager Configuration
>>
>> #    -r number of retries when monitoring a host
>>
>> #    -t number of threads, i.e. number of hosts monitored at the same time
>>
>> #-------------------------------------------------------------------------------
>>
>> #IM_MAD = [
>>
>> #    name       = "im_xen",
>>
>> #    executable = "one_im_ssh",
>>
>> #    arguments  = "xen" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #-------------------------------------------------------------------------------
>>
>> #  EC2 Information Driver Manager Configuration
>>
>> #-------------------------------------------------------------------------------
>>
>> #IM_MAD = [
>>
>> #      name       = "im_ec2",
>>
>> #      executable = "one_im_ec2",
>>
>> #      arguments  = "im_ec2/im_ec2.conf" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #-----------------------------------------------------------------------------
>>
>> #  Ganglia Information Driver Manager Configuration
>>
>> #-----------------------------------------------------------------------------
>>
>> #IM_MAD = [
>>
>> #      name       = "im_ganglia",
>>
>> #      executable = "one_im_sh",
>>
>> #      arguments  = "ganglia" ]
>>
>> #-----------------------------------------------------------------------------
>>
>> #-------------------------------------------------------------------------------
>>
>> #  Dummy Information Driver Manager Configuration
>>
>> #-------------------------------------------------------------------------------
>>
>> #IM_MAD = [ name="im_dummy", executable="one_im_dummy"]
>>
>> #-------------------------------------------------------------------------------
>>
>> #*******************************************************************************
>>
>> # Virtualization Driver Configuration
>>
>> #*******************************************************************************
>>
>> # You can add more virtualization managers with different configurations but
>>
>> # make sure it has different names.
>>
>> #
>>
>> #   name      : name of the virtual machine manager driver
>>
>> #
>>
>> #   executable: path of the virtualization driver executable, can be an
>>
>> #               absolute path or relative to $ONE_LOCATION/lib/mads (or
>>
>> #               /usr/lib/one/mads/ if OpenNebula was installed in /)
>>
>> #
>>
>> #   arguments : for the driver executable
>>
>> #
>>
>> #   default   : default values and configuration parameters for the
>> driver, can
>>
>> #               be an absolute path or relative to $ONE_LOCATION/etc (or
>>
>> #               /etc/one/ if OpenNebula was installed in /)
>>
>> #
>>
>> #   type      : driver type, supported drivers: xen, kvm, xml
>>
>> #*******************************************************************************
>>
>> #-------------------------------------------------------------------------------
>>
>> #  KVM Virtualization Driver Manager Configuration
>>
>> #    -r number of retries when monitoring a host
>>
>> #    -t number of threads, i.e. number of hosts monitored at the same time
>>
>> #    -p name of the poll probe (executed locally)
>>
>> #-------------------------------------------------------------------------------
>>
>> VM_MAD = [
>>
>>     name       = "vmm_kvm",
>>
>>     executable = "one_vmm_ssh",
>>
>>     arguments  = "-t 15 -r 0 kvm",
>>
>>     default    = "vmm_ssh/vmm_ssh_kvm.conf",
>>
>>     type       = "kvm" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #-------------------------------------------------------------------------------
>>
>> #  XEN Virtualization Driver Manager Configuration
>>
>> #    -r number of retries when monitoring a host
>>
>> #    -t number of threads, i.e. number of hosts monitored at the same time
>>
>> #    -l do not perform the VM polling in the node
>>
>> #    -p name of the poll probe (executed locally)
>>
>> #-------------------------------------------------------------------------------
>>
>> #VM_MAD = [
>>
>> #    name       = "vmm_xen",
>>
>> #    executable = "one_vmm_ssh",
>>
>> #    arguments  = "xen",
>>
>> #    default    = "vmm_ssh/vmm_ssh_xen.conf",
>>
>> #    type       = "xen" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #-------------------------------------------------------------------------------
>>
>> #  EC2 VirtualizationDriver Manager Configuration
>>
>> #    arguments: default values for the EC2 driver, can be an absolute
>> path or
>>
>> #               relative to $ONE_LOCATION/etc (or /etc/one/ if
>> OpenNebula was
>>
>> #               installed in /).
>>
>> #-------------------------------------------------------------------------------
>>
>> #VM_MAD = [
>>
>> #    name       = "vmm_ec2",
>>
>> #    executable = "one_vmm_ec2",
>>
>> #    arguments  = "vmm_ec2/vmm_ec2.conf",
>>
>> #    type       = "xml" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #-------------------------------------------------------------------------------
>>
>> #  Dummy Virtualization Driver Configuration
>>
>> #-------------------------------------------------------------------------------
>>
>> #VM_MAD = [ name="vmm_dummy", executable="one_vmm_dummy", type="xml" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #*******************************************************************************
>>
>> # Transfer Manager Driver Configuration
>>
>> #*******************************************************************************
>>
>> # You can add more transfer managers with different configurations but make
>>
>> # sure it has different names.
>>
>> #   name      : name for this transfer driver
>>
>> #
>>
>> #   executable: path of the transfer driver executable, can be an
>>
>> #               absolute path or relative to $ONE_LOCATION/lib/mads (or
>>
>> #               /usr/lib/one/mads/ if OpenNebula was installed in /)
>>
>> #
>>
>> #   arguments : for the driver executable, usually a commands
>> configuration file
>>
>> #               , can be an absolute path or relative to
>> $ONE_LOCATION/etc (or
>>
>> #               /etc/one/ if OpenNebula was installed in /)
>>
>> #*******************************************************************************
>>
>> #-------------------------------------------------------------------------------
>>
>> # NFS Transfer Manager Driver Configuration
>>
>> #-------------------------------------------------------------------------------
>>
>> #TM_MAD = [
>>
>> #    name       = "tm_nfs",
>>
>> #    executable = "one_tm",
>>
>> #    arguments  = "tm_nfs/tm_nfs.conf" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #-------------------------------------------------------------------------------
>>
>> # SSH Transfer Manager Driver Configuration
>>
>> #-------------------------------------------------------------------------------
>>
>> TM_MAD = [
>>
>>     name       = "tm_ssh",
>>
>>     executable = "one_tm",
>>
>>     arguments  = "tm_ssh/tm_ssh.conf" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #-------------------------------------------------------------------------------
>>
>> # Dummy Transfer Manager Driver Configuration
>>
>> #-------------------------------------------------------------------------------
>>
>> #TM_MAD = [
>>
>> #    name       = "tm_dummy",
>>
>> #    executable = "one_tm",
>>
>> #    arguments  = "tm_dummy/tm_dummy.conf" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #-------------------------------------------------------------------------------
>>
>> # LVM Transfer Manager Driver Configuration
>>
>> #-------------------------------------------------------------------------------
>>
>> #TM_MAD = [
>>
>> #    name       = "tm_lvm",
>>
>> #    executable = "one_tm",
>>
>> #    arguments  = "tm_lvm/tm_lvm.conf" ]
>>
>> #-------------------------------------------------------------------------------
>>
>> #*******************************************************************************
>>
>> # Hook Manager Configuration
>>
>> #*******************************************************************************
>>
>> # The Driver (HM_MAD), used to execute the Hooks
>>
>> #   executable: path of the hook driver executable, can be an
>>
>> #               absolute path or relative to $ONE_LOCATION/lib/mads (or
>>
>> #               /usr/lib/one/mads/ if OpenNebula was installed in /)
>>
>> #
>>
>> #   arguments : for the driver executable, can be an absolute path or
>> relative
>>
>> #               to $ONE_LOCATION/etc (or /etc/one/ if OpenNebula was
>> installed
>>
>> #               in /)
>>
>> #
>>
>> # Virtual Machine Hooks (VM_HOOK) defined by:
>>
>> #   name      : for the hook, useful to track the hook (OPTIONAL)
>>
>> #   on        : when the hook should be executed,
>>
>> #               - CREATE, when the VM is created (onevm create)
>>
>> #               - RUNNING, after the VM is successfully booted
>>
>> #               - SHUTDOWN, after the VM is shutdown
>>
>> #               - STOP, after the VM is stopped (including VM image
>> transfers)
>>
>> #               - DONE, after the VM is deleted or shutdown
>>
>> #               - FAILED, when the VM enters the failed state
>>
>> #   command   :path can be absolute or relative to $ONE_LOCATION/share/hooks
>>
>> #               case of self-contained installation or relative to
>>
>> #               /usr/share/one/hooks in case of system-wide installation
>>
>> #   arguments : for the hook. You can access to VM template variables with $
>>
>> #               - $ATTR, the value of an attribute e.g. $NAME or $VMID
>>
>> #               - $ATTR[VAR], the value of a vector e.g. $NIC[MAC]
>>
>> #               - $ATTR[VAR, COND], same of previous but COND select between
>>
>> #                multiple ATTRs e.g. $NIC[MAC, NETWORK="Public"]
>>
>> #   remote    : values,
>>
>> #               - YES, The hook is executed in the host where the VM was
>>
>> #                 allocated
>>
>> #               - NO, The hook is executed in the OpenNebula server
>> (default)
>>
>> #
>>
>> #
>>
>> # Host Hooks (HOST_HOOK) defined by:
>>
>> #   name      : for the hook, useful to track the hook (OPTIONAL)
>>
>> #   on        : when the hook should be executed,
>>
>> #               - CREATE, when the Host is created (onehost create)
>>
>> #               - ERROR, when the Host enters the error state
>>
>> #               - DISABLE, when the Host is disabled
>>
>> #   command   : path can be absolute or relative to
>> $ONE_LOCATION/share/hooks
>>
>> #               case of self-contained installation or relative to
>>
>> #               /usr/share/one/hooks in case of system-wide installation
>>
>> #   arguments : for the hook. You can use the Host ID with $HID to pass
>> it as
>>
>> #               argument for the hook
>>
>> #   remote    : values,
>>
>> #               - YES, The hook is executedin the host
>>
>> #               - NO, The hook is executed in the OpenNebula server
>> (default)
>>
>> #-------------------------------------------------------------------------------
>>
>> HM_MAD = [
>>
>>     executable = "one_hm" ]
>>
>> #-------------------------------- Image Hook
>> -----------------------------------
>>
>> # This hook is used to handle image saving and overwriting when virtual
>> machines
>>
>> # reach the DONE state after being shutdown.
>>
>> VM_HOOK = [
>>
>>     name      = "image",
>>
>>     on        = "DONE",
>>
>>     command   = "image.rb",
>>
>>     arguments = "$VMID" ]
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opennebula.org
>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
> 
> 


-- 
Héctor Sanjuan
OpenNebula.org



More information about the Users mailing list