-
Notifications
You must be signed in to change notification settings - Fork 479
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
Allowing autostart setting for KVM deployed VMs with persistent images, to restart them upon node reboot #599
Comments
Original Redmine Comment Sounds great but, isn't this KVM specific ? Although I am using KVM, I like the way Opennebula tries to be as much "cross hypervisor" as possible. |
Original Redmine Comment jordan pittier wrote:
I don't think this is specific to KVM (although I mentioned KVM in the title of this ticket), as it is a a libvirt option (see http://libvirt.org/sources/virshcmdref/html/sect-autostart.html). Still it may happen that libvirt only supports this for KVM. I haven't tested with others. But I couldn't imagine other hypervisors wouldn't have such a feature :-/ |
Original Redmine Comment You are correct. The this is, Opennebula uses libvirt only to manage KVM hosts. |
Original Redmine Comment +1 It could be great to have a checkbox option in template definition and/or at VM instance time. Some tests may be performed before enabling the “autostart” as I'm not sure it will work for non-persistent disk. Thanks. |
Original Redmine Comment Daniel Dehennin wrote:
We could also define a name prefix to use when ONE will @onetemplate instanciate@ automatically.
I thought a little to this issue as we need it and I wonder if it could not be implemented with actual features of ONE instead of using libvirt feature (for KVM). In fact, I'm quite sure we should not use libvirt to manage this even for KVM VMs, on my own system, service dependencies is problematic between libvirt and OpenvSwitch. Instead we could use the @suspend@, @Stop@ and @resume@ mechanisms, making it working with non-persistent storage if I understood correctly theses commands. We must face different use-cases, depending of what happen and if we are in single node or multi nodes. For single node
when the ONE node is shutdown, we could just run @OneVM suspend@ all the running VM and put them in an @autoboot@ state.when the ONE node is booted, run @OneVM resume@ on each VMs in @autoboot@ state
when the ONE node is bootedrun @OneVM boot@ on each VMs in @unknown@ state using an auto-start enabled templatesearch for auto-start enabled templates and for each one: if no @running@ VMs use it, run @onetemplate instanciate@For multi-nodes
I'm not sure about the best thing to do on hardware failure, in fact, as I'm missing test machines for now I don't even know what ONE does in such situation. Regards. |
Original Redmine Comment The ideal would be to have a trusted synchronous communication from the node to the frontend to report a shutdown/reboot. My idea it to use the monitoring system with an init script on the node like the @libvirt-guest@ one:
This will not work with pull based monitoring. Another option is to hit the frontend directly by RPC but this requires authentication/authorization of nodes on the frontend. Is there a way for nodes to advertise the frontend of a shutdown/reboot? |
Original Redmine Comment
In a shutdown/reboot cycle:
So I'd suggest
I really like this approach as it is hypervisor independent. |
Original Redmine Comment Ruben S. Montero wrote:
Could we make a difference between VMs in @power-off@ because of the reboot and VMs in @power-off@ because user want them powered off? I'm not sure we can blindly boot VMs after a reboot.
Yes, me too, even if I personally only use KVM ;-) Regards. |
Original Redmine Comment EOLE Team wrote:
Yes I think we can use the REASON field of history. Simply add a new reason for automatic transitions (vs user requested). This together with the uptime of the host should be enough... Chhers |
Original Redmine Comment FWIW, a discussion about this issue : https://forum.opennebula.org/t/automatically-restart-vms-after-host-restart/454 Any progress to expect ? |
Original Redmine Comment Olivier Berger wrote:
Btw, the list archive is gone, but one can still find it on https://www.mail-archive.com/users%40lists.opennebula.org/msg06649.html Hth |
Original Redmine Comment Would it be possible to at least have KVM VMs created as non-transient, i.e. using virsh define + virsh start instead of just virsh create so that it is possible to manually perform a virsh autostart if needed (virsh autostart won't work on transient VMs), like in https://gist.github.com/anonymous/2776202, but without line 34 ? I'm not sure there would be any side effects, and that would be a first improvement for KVM, until a more generic solution is found ? |
Original Redmine Comment Yes the main reason for holding this back is the side effects for all the operations. I agree the idea would be to define+start and when the VM is removed from the host it needs to be undefined. We need to review all the operations to check when we need to do the undefine, e.g. poweroff, migrations etc... now it is assumed that the VM is not defined. |
Original Redmine Comment Ruben S. Montero wrote:
Could we open a new issue for this point ? This could solve the “host crashed” case:
Then, we should add the possiblity to have a @HOST_HOOK@ executed when a host enter the @on@ state, in which case we list all VMs on that host in @PowerOff@ state without any @Reason@ and @resume@ them. Regards. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. The OpenNebula Dev Team |
Thanks for keeping this in backlog 👍 |
Does that mean that OpenNebula does not support restarting VM after their host has been rebooted? |
yes .. this is really a good an important question ..
But this will not work on OpenNebula controlled VMs --> error: Failed to mark domain 2 as autostarted |
Hi, There are 2 considerations here:
https://docs.opennebula.io/5.12/advanced_components/ha/ftguide.html#host-failures Maybe, we can extend this hook to not recreate VMs in other hosts, but rather the host to be back online. This could be executed by a simple hook (restart host VMs in UKNOWN when the host go back to "online") What do you think? |
yes,Ruben .. this would probably make sense (as addition) to extend the hook, that it would be possible to NOT recreate VMs in other hosts - (i also simply thought to create a own script for that). On the other hand, i would need such a solution as well (that when one host goes down or not working properly), than through a hook the vm would be migrated to another host. But i never tested that .. i'm using this kind of design --> Important data are on Host1 --> host1:/datastore_ssd per Sunstone all DS are NFS-Shared - but only sunstone will see all (nfs-shared) DS. What would happen by an automatic VM-Migrate hook from host1: to host2: ? [root@sunstone ~]# onedatastore list 101 oneadmin oneadmin data_hd_srv 16T 99% 0 1 img fs qcow2 on [root@sunstone ~]# df -h host1:/home/datastores 4.0T 297G 3.8T 8% /mnt/datastores/nfs-dsnvme-srv |
Author Name: Olivier Berger (Olivier Berger)
Original Redmine Issue: 1290, https://dev.opennebula.org/issues/1290
Original Date: 2012-05-23
As discussed in http://lists.opennebula.org/pipermail/users-opennebula.org/2012-May/008959.html I think it would be great to offer some support for automatic restarting of VMs (libvirt autostart setting) images that would have persistent images, in case a node is rebooted (or in case of power outages and other restarts).
One main change involved is the need to define the domains, instead of transient domains.
See the discussion of proposed changes
The text was updated successfully, but these errors were encountered: