Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

koan should wait for a VM to be in VIR_DOMAIN_SHUTOFF state before recreating the domain #26

Open
pieterlauwers opened this issue Nov 9, 2017 · 0 comments
Labels

Comments

@pieterlauwers
Copy link

pieterlauwers commented Nov 9, 2017

When the VM is halted at the end of the installation, koan can restart the VM.
In this case, koan waits until the vm is shutdown and then performs a virsh create for the VM.

I noticed in several occasions that the creation failed with error
`

  • polling for virt completion
  • install is still running, sleeping for 1 minute (0)
  • install is still running, sleeping for 1 minute (1)
  • install is still running, sleeping for 1 minute (2)
  • install is still running, sleeping for 1 minute (3)
  • install is still running, sleeping for 1 minute (4)
  • shutdown VM detected, is the install done? Restarting!
    <class 'libvirt.libvirtError'>
    Requested operation is not valid: domain is already running
    File "/usr/lib/python2.6/site-packages/koan/app.py", line 274, in main
    k.run()
    File "/usr/lib/python2.6/site-packages/koan/app.py", line 424, in run
    self.virt()
    File "/usr/lib/python2.6/site-packages/koan/app.py", line 844, in virt
    return self.net_install(after_download)
    File "/usr/lib/python2.6/site-packages/koan/app.py", line 671, in net_install
    after_download(self, profile_data)
    File "/usr/lib/python2.6/site-packages/koan/app.py", line 842, in after_download
    self.virt_net_install(profile_data)
    File "/usr/lib/python2.6/site-packages/koan/app.py", line 1562, in virt_net_install
    utils.find_vm(conn, virtname).create()
    File "/usr/lib64/python2.6/site-packages/libvirt.py", line 686, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
    `

i think this is caused by the status polling that interprets the domain status VIR_DOMAIN_SHUTDOWN the same as VIR_DOMAIN_SHUTOFF. But VIR_DOMAIN_SHUTDOWN means

the domain is being shut down

And in this state the VM can't be recreated (yet).
This error happens only now and again because the VIR_DOMAIN_SHUTDOWN state is short lived (less than a second in my tests) and the polling interval is 60 seconds.

CentOS release 6.9 (Final)
koan-2.6.11-1.el6.noarch
libvirt-0.10.2-62.el6.x86_64

@SchoolGuy SchoolGuy added the bug label Jul 31, 2019
@SchoolGuy SchoolGuy moved this to Bug Reports in Koan Sep 26, 2022
@SchoolGuy SchoolGuy added this to Koan Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Bug Reports
Development

No branches or pull requests

2 participants