Autostart vm's at host boot on local storage

--_CC286E1A-A3A3-481A-AB16-0EE929F3B4A9_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="Windows-1252" Can this be done? We hit a road block with gluster and will be using local = storage while testing gluster. Only problem, if a host reboots, the vm's on= that host do not. Is there a way to have ovirt/libvirt start all vm's resi= ding on the local storage?= --_CC286E1A-A3A3-481A-AB16-0EE929F3B4A9_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="Windows-1252" <HTML><HEAD> <META content=3D"text/html; charset=3Dwindows-1252" http-equiv=3DContent-Ty= pe></HEAD> <BODY> <DIV> <DIV style=3D"FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">Can this be= done? We hit a road block with gluster and will be using local storage whi= le testing gluster. Only problem, if a host reboots, the vm's on that host = do not. Is there a way to have ovirt/libvirt start all vm's residing on the= local storage?</DIV></DIV></BODY></HTML>= --_CC286E1A-A3A3-481A-AB16-0EE929F3B4A9_--

------=_Part_1317814_857216270.1419334811609 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit I don't think there is a way to do this via GUI. You can create a script to do this in boot via ovirt-cli or API. Yaniv ----- Original Message -----
From: "Brent Hartzell" <brent.hartzell@outlook.com> To: users@ovirt.org Sent: Tuesday, December 23, 2014 6:53:48 AM Subject: [ovirt-users] Autostart vm's at host boot on local storage
Can this be done? We hit a road block with gluster and will be using local storage while testing gluster. Only problem, if a host reboots, the vm's on that host do not. Is there a way to have ovirt/libvirt start all vm's residing on the local storage?
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
------=_Part_1317814_857216270.1419334811609 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <html><body><div style=3D"font-family: Arial; font-size: 10pt; color: #0000= 00"><div>I don't think there is a way to do this via GUI.</div><div>You can= create a script to do this in boot via ovirt-cli or API.<br></div><div><br=
</div><div><br></div><div>Yaniv<br></div><div><br></div><div><br></div><hr= id=3D"zwchr"><blockquote style=3D"border-left:2px solid #1010FF;margin-lef= t:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text= -decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" da= ta-mce-style=3D"border-left: 2px solid #1010FF; margin-left: 5px; padding-l= eft: 5px; color: #000; font-weight: normal; font-style: normal; text-decora= tion: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>F= rom: </b>"Brent Hartzell" <brent.hartzell@outlook.com><br><b>To: </b>= users@ovirt.org<br><b>Sent: </b>Tuesday, December 23, 2014 6:53:48 AM<br><b= Subject: </b>[ovirt-users] Autostart vm's at host boot on local storage<br= <div><br></div><div><div style=3D"FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sa= ns-serif" data-mce-style=3D"font-size: 11pt; font-family: Calibri,sans-seri= f;">Can this be done? We hit a road block with gluster and will be using lo= cal storage while testing gluster. Only problem, if a host reboots, the vm'= s on that host do not. Is there a way to have ovirt/libvirt start all vm's = residing on the local storage?</div></div><br>_____________________________= __________________<br>Users mailing list<br>Users@ovirt.org<br>http://lists= .ovirt.org/mailman/listinfo/users<br></blockquote><div><br></div></div></bo= dy></html> ------=_Part_1317814_857216270.1419334811609--

<div id=3D"yui_3_16_0_1_1419155725169_168070" dir=3D"ltr">[2] <a id=3D"yui= _3_16_0_1_1419155725169_168069" href=3D"http://www.ovirt.org/Features/Watch= dog_engine_support">http://www.ovirt.org/Features/Watchdog_engine_support</= a><br></div><div id=3D"yui_3_16_0_1_1419155725169_167376"><span></span></di= v> <div id=3D"yui_3_16_0_1_1419155725169_172314" class=3D"qtdSeparateBR"><b= r><br></div><div id=3D"yui_3_16_0_1_1419155725169_172319" style=3D"display:= block;" class=3D"yahoo_quoted"> <div id=3D"yui_3_16_0_1_1419155725169_1723= 18" style=3D"font-family: HelveticaNeue-Light, Helvetica Neue Light, Helvet= ica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <=
------=_Part_609840_1125647346.1419339091357 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Brent, You can achieve that using oVirt "High Availability" [1],=C2=A0 Also see "WatchDog" [2] (if you want your guests to bemonitored on the OS l= evel for responsiveness). [1] http://www.ovirt.org/OVirt_3.0_Feature_Guide#High_availability[2] http:= //www.ovirt.org/Features/Watchdog_engine_support =20 On Tuesday, December 23, 2014 6:54 AM, Brent Hartzell <brent.hartzell@= outlook.com> wrote: =20 Can this be done? We hit a road block with gluster and will be using loca= l storage while testing gluster. Only problem, if a host reboots, the vm's = on that host do not. Is there a way to have ovirt/libvirt start all vm's re= siding on the local storage? _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users ------=_Part_609840_1125647346.1419339091357 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <html><body><div style=3D"color:#000; background-color:#fff; font-family:He= lveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, = Lucida Grande, sans-serif;font-size:16px"><div id=3D"yui_3_16_0_1_141915572= 5169_167379">Brent,</div><div id=3D"yui_3_16_0_1_1419155725169_167661"><br>= </div><div id=3D"yui_3_16_0_1_1419155725169_167651" dir=3D"ltr">You can ach= ieve that using oVirt "High Availability" [1], </div><div id=3D"yui_3_= 16_0_1_1419155725169_173299" dir=3D"ltr"><br></div><div id=3D"yui_3_16_0_1_= 1419155725169_168945" dir=3D"ltr">Also see "WatchDog" [2] (if you want your= guests to be</div><div id=3D"yui_3_16_0_1_1419155725169_172820" dir=3D"ltr= ">monitored on the OS level for responsiveness).<br></div><div id=3D"yui_3_= 16_0_1_1419155725169_167662" dir=3D"ltr"><br></div><div id=3D"yui_3_16_0_1_= 1419155725169_167655" dir=3D"ltr">[1] <a id=3D"yui_3_16_0_1_1419155725169_1= 67654" href=3D"http://www.ovirt.org/OVirt_3.0_Feature_Guide#High_availabili= ty">http://www.ovirt.org/OVirt_3.0_Feature_Guide#High_availability</a></div= div id=3D"yui_3_16_0_1_1419155725169_172317" style=3D"font-family: Helvetic= aNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-si= ze: 16px;"> <div id=3D"yui_3_16_0_1_1419155725169_172316" dir=3D"ltr"> <fon= t id=3D"yui_3_16_0_1_1419155725169_172315" face=3D"Arial" size=3D"2"> On Tu= esday, December 23, 2014 6:54 AM, Brent Hartzell <brent.hartzell@outlook= .com> wrote:<br> </font> </div> <br><br> <div class=3D"y_msg_container"=
<div id=3D"yiv4618363530"> =20 <div> <div> <div style=3D"FONT-SIZE:11pt;FONT-FAMILY:Calibri, sans-serif;">Can this be = done? We hit a road block with gluster and will be using local storage whil= e testing gluster. Only problem, if a host reboots, the vm's on that host d= o not. Is there a way to have ovirt/libvirt start all vm's residing on the = local storage?</div></div></div></div><br>_________________________________= ______________<br>Users mailing list<br><a ymailto=3D"mailto:Users@ovirt.or= g" href=3D"mailto:Users@ovirt.org">Users@ovirt.org</a><br><a href=3D"http:/= /lists.ovirt.org/mailman/listinfo/users" target=3D"_blank">http://lists.ovi= rt.org/mailman/listinfo/users</a><br><br><br></div> </div> </div> </div> = </div></body></html> ------=_Part_609840_1125647346.1419339091357--

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 23.12.2014 13:51, Michael Pasternak wrote:
Brent, You can achieve that using oVirt "High Availability" [1], This does not work for local storage.
See my rejected BZ Entry: https://bugzilla.redhat.com/show_bug.cgi?id=1113165 I also have one open to allow for some kind of autostart flag (as qemu/libvirt are capable of this): https://bugzilla.redhat.com/show_bug.cgi?id=1166657 kind regards Sven -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQGcBAEBAgAGBQJUqUS7AAoJEAq0kGAWDrqlq/8L/14HigJ56dpl8OUpdQSvQq5a zkJbdX7tCmPedmcFmA7CwGqg2m2zWMVzb0KmAu9MuY+Xz6mluxW20iEVtP1yBmB+ dCRXcv9rzqDX4E88FL81q5ceqT6lpTDN7MK/Kz1IhK2mK20H0ibdXS9NB0WrKcqY UI3tBQVn9gCH/4qyquWH7OXiOU8f5loJ7X9e/Akyp5F9wsqGdqmCClAuI/ArewhS /VSMqHGaM43ZViz+1EqD8l05mbD7GLcnG5K3LnIpO5jaWx1aHSBHechlLhGMH+PM Smj4bmc00W/DD9MAgNrgQg4jG/FZ58WNxw1BFtHJ3zn1EuvcW0t3pUQsF9dZH/wI aMqZ5195ucdfll6zSG6R9cOGYjDlYUuXccn2tWvDWQhMDCUF0rYC0JSLeB+vRVKz OeZ2esI4ofoF21vVb8L7jFoweJoBlB81US2UUQN3Vq93BugiLPPkyGUbsYkki6k1 xPU2lMEQ2IpMOiJ+Lu28BhhDL1P5HLbLl1KOS69dPA== =FlbA -----END PGP SIGNATURE-----

This is a multi-part message in MIME format. --------------050206020405050204030201 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit There was a discussion on this list a year or so ago about this. I believe one of the developers responded that oVirt has no facility to start VMs on a boot, and explained why.... I use the following 2 scripts to start VMs automatically when my AIO host reboots for whatever reason. The Python script was grabbed from somewhere on the net, I don't remember where anymore. I run the first script out of cron every 15 minutes. #!/bin/bash VMSTART="vm1 vm2 vm...." for vm in ${VMSTART} do echo "Do I need to start ${vm}" /root/bin/vm_up ${vm} if [ $? -eq 1 ]; then TEXT="VM ${vm} needed starting" echo "${TEXT}" echo "${TEXT}" | mailx -s "${TEXT}" root@domain.com fi done #!/usr/bin/python import sys, string from time import sleep from ovirtsdk.api import API from ovirtsdk.xml import params VERSION = params.Version(major='3', minor='0') URL = 'https://host.domain/api' USERNAME = 'admin@internal' PASSWORD = 'passwd' CA_FILE = '/etc/pki/ovirt-engine/ca.pem' VM_NAME = sys.argv[1] api = API(url=URL, username=USERNAME, password=PASSWORD, ca_file=CA_FILE) try: if api.vms.get(VM_NAME).status.state != 'up': print 'Starting VM' api.vms.get(VM_NAME).start() print 'Waiting for VM to reach UP status' while api.vms.get(VM_NAME).status.state != 'up': sleep(1) sys,exit(1) else: print 'VM already up' sys.exit(0) except Exception as e: print 'Failed to Start VM:\n%s' % str(e) On 12/22/2014 10:53 PM, Brent Hartzell wrote:
Can this be done? We hit a road block with gluster and will be using local storage while testing gluster. Only problem, if a host reboots, the vm's on that host do not. Is there a way to have ovirt/libvirt start all vm's residing on the local storage?
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
--------------050206020405050204030201 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit <html> <head> <meta content="text/html; charset=windows-1252" http-equiv="Content-Type"> </head> <body bgcolor="#FFFFFF" text="#000000"> <div class="moz-cite-prefix">There was a discussion on this list a year or so ago about this. I believe one of the developers responded that oVirt has no facility to start VMs on a boot, and explained why....<br> <br> I use the following 2 scripts to start VMs automatically when my AIO host reboots for whatever reason. The Python script was grabbed from somewhere on the net, I don't remember where anymore.<br> I run the first script out of cron every 15 minutes.<br> <br> #!/bin/bash<br> <br> VMSTART="vm1 vm2 vm...."<br> <br> for vm in ${VMSTART}<br> do<br> echo "Do I need to start ${vm}"<br> /root/bin/vm_up ${vm}<br> if [ $? -eq 1 ]; then<br> TEXT="VM ${vm} needed starting"<br> echo "${TEXT}"<br> echo "${TEXT}" | mailx -s "${TEXT}" <a class="moz-txt-link-abbreviated" href="mailto:root@domain.com">root@domain.com</a><br> fi<br> done<br> <br> #!/usr/bin/python<br> <br> import sys, string<br> from time import sleep<br> <br> from ovirtsdk.api import API<br> from ovirtsdk.xml import params<br> <br> VERSION = params.Version(major='3', minor='0')<br> <br> URL = '<a class="moz-txt-link-freetext" href="https://host.domain/api">https://host.domain/api</a>'<br> USERNAME = 'admin@internal'<br> PASSWORD = 'passwd'<br> CA_FILE = '/etc/pki/ovirt-engine/ca.pem'<br> <br> VM_NAME = sys.argv[1]<br> <br> api = API(url=URL, username=USERNAME, password=PASSWORD, ca_file=CA_FILE)<br> <br> <br> try:<br> if api.vms.get(VM_NAME).status.state != 'up':<br> print 'Starting VM'<br> api.vms.get(VM_NAME).start()<br> print 'Waiting for VM to reach UP status'<br> while api.vms.get(VM_NAME).status.state != 'up':<br> sleep(1)<br> sys,exit(1)<br> else:<br> print 'VM already up'<br> sys.exit(0)<br> except Exception as e:<br> print 'Failed to Start VM:\n%s' % str(e)<br> <br> <br> <br> On 12/22/2014 10:53 PM, Brent Hartzell wrote:<br> </div> <blockquote cite="mid:BLU406-EAS33C525FD5ADA0BE92E01188D570@phx.gbl" type="cite"> <meta content="text/html; charset=windows-1252" http-equiv="Content-Type"> <div> <div style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">Can this be done? We hit a road block with gluster and will be using local storage while testing gluster. Only problem, if a host reboots, the vm's on that host do not. Is there a way to have ovirt/libvirt start all vm's residing on the local storage?</div> </div> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">_______________________________________________ Users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Users@ovirt.org">Users@ovirt.org</a> <a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/users">http://lists.ovirt.org/mailman/listinfo/users</a> </pre> </blockquote> <br> </body> </html> --------------050206020405050204030201--
participants (5)
-
Blaster
-
Brent Hartzell
-
Michael Pasternak
-
Sven Kieske
-
Yaniv Dary