kimchi-project / gingerbase

Gingerbase: basic host management for WoK
Other
47 stars 25 forks source link

reset/shutdown is saying 'there are virtual machines running' when libvirt is not enabled #127

Closed danielhb closed 8 years ago

danielhb commented 8 years ago

When running wok+gingerbase+ginger+kimchi, without libvirt running, a message appears in every tab saying 'KCHCONN0002E: Libvirt service is not active. Please start the libvirt service in your host system.'.

When trying to restart/shutdown the system in these conditions, a message 'GGBHOST6001E: Unable to shut down system as there are some virtual machines running! ' appears. How can it tell if there are VM running if libvirt is not running?

I believe the following error that appears in the log has something to do with it:

537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36"
libvirt: XML-RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 859, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 732, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 471, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.7/logging/__init__.py", line 335, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file host.py, line 386
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 859, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 732, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 471, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.7/logging/__init__.py", line 335, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file host.py, line 386
GGBHOST0003E: There may be virtual machines running on the host

I consider this to be a border case (why would you run Kimchi without libvirt?) but it's a bug and should be fixed anyway.

pvital commented 8 years ago

IMO, if you are starting kimchi and libvirtd is not loaded/running, kimchi should not be loaded and a message presented to user. But, this is a special case and a lot were discussed about it.

Now, if you are running all plugins and libvirt is not running the message must be showed, and if user decides shutdow/reboot the host, he can do this. This is the bug here. The message "GGBHOST0003E: There may be virtual machines running on the host" must not be presented and the host should shutdow/reboot with no problems if libvirt is not running.

danielhb commented 8 years ago

'Now, if you are running all plugins and libvirt is not running the message must be showed, and if user decides shutdow/reboot the host, he can do this. This is the bug here. The message "GGBHOST0003E: There may be virtual machines running on the host" must not be presented and the host should shutdow/reboot with no problems if libvirt is not running.'

yep, this is the behavior I would expect in this situation as well

pvital commented 8 years ago

Good, I was a little confuse with your description. If you want, you can assign this issue to me.

danielhb commented 8 years ago

Patch was already sent for review, but thanks for volunteering!