Mailing List Archive

Autostart with XCP on Debian 7
Hi,

Having a hard time here setting up VMs to auto-poweron on Debain 7/XAPI.
I've done the following:

xe pool-set-param uuid=<pool uuid> other-config=auto_poweron:true

and

xe vm-set-param uuid=<vm uuid> other-config=auto_poweron:true

but on reboot it isn't spinning the VM up automatically.

Any other suggestions? I googled for a goo 30 mins on it today and
couldn't find any alternative suggestions :\

--

Mark Benson

_______________________________________________
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
Re: Autostart with XCP on Debian 7 [ In reply to ]
Hi,

> On 30 Oct 2014, at 19:02, Mark Benson <md.benson@gmail.com> wrote:
>
> Hi,
>
> Having a hard time here setting up VMs to auto-poweron on Debain 7/XAPI. I've done the following:
>
> xe pool-set-param uuid=<pool uuid> other-config=auto_poweron:true
>
> and
>
> xe vm-set-param uuid=<vm uuid> other-config=auto_poweron:true
>
> but on reboot it isn't spinning the VM up automatically.
>
> Any other suggestions? I googled for a goo 30 mins on it today and couldn't find any alternative suggestions :\

I believe the auto_poweron key is supposed to be interpreted by a startup script, something like:

#!/bin/sh
xe vm-start other-config:auto_poweron=true power-state=halted --multiple

HTH,
Dave
_______________________________________________
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
Re: Autostart with XCP on Debian 7 [ In reply to ]
On 30/10/2014 21:07, Dave Scott wrote:
> #!/bin/sh
> xe vm-start other-config:auto_poweron=true power-state=halted --multiple
>
> HTH,
> Dave

So if I drop that somewhere like rc.local it'll boot the required VMS on
startup if they are at the 'halted' state, for instantce?

Thanks,

--

Mark

_______________________________________________
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
Re: Autostart with XCP on Debian 7 [ In reply to ]
> On 31 Oct 2014, at 08:01, Mark Benson <md.benson@gmail.com> wrote:
>
>
>
> On 30/10/2014 21:07, Dave Scott wrote:
>> #!/bin/sh
>> xe vm-start other-config:auto_poweron=true power-state=halted --multiple
>>
>> HTH,
>> Dave
>
> So if I drop that somewhere like rc.local it'll boot the required VMS on startup if they are at the 'halted' state, for instantce?

That’s right. It should work provided xapi has already been started.

Cheers,
Dave
_______________________________________________
Xen-api mailing list
Xen-api@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-api
Re: Autostart with XCP on Debian 7 [ In reply to ]
On Fri, Oct 31, 2014 at 8:50 AM, Dave Scott <Dave.Scott@citrix.com> wrote:

> >> #!/bin/sh
> >> xe vm-start other-config:auto_poweron=true power-state=halted --multiple
> >>
> >> HTH,
> >> Dave
> >
> > So if I drop that somewhere like rc.local it'll boot the required VMS on
> startup if they are at the 'halted' state, for instantce?
>
> That’s right. It should work provided xapi has already been started.
>

Thanks. Yeah rc.local runs last of all after all the other init scripts on
Debian AFAIK so it's *fairly* safe.. It worked a treat

Something I noticed the dom0 takes quite a long time to finish booting up
now as one of my VMs (Debian 5 lenny) takes a while to return a 'started'
state via the xe-tools (sits at yellow in XenCenter for a wile after it's
console hits the login prompt).

Also, if I add a startup delay to one of the VMs will xapi respect this and
defer it's start-up on running this command?

--

Mark Benson
Re: Autostart with XCP on Debian 7 [ In reply to ]
Den 30-10-2014 20:02, Mark Benson skrev:
> Hi,
>
> Having a hard time here setting up VMs to auto-poweron on Debain
> 7/XAPI. I've done the following:
>
> xe pool-set-param uuid=<pool uuid> other-config=auto_poweron:true
>
> and
>
> xe vm-set-param uuid=<vm uuid> other-config=auto_poweron:true
>
> but on reboot it isn't spinning the VM up automatically.
>
> Any other suggestions? I googled for a goo 30 mins on it today and
> couldn't find any alternative suggestions :\
>

I am using a vApp. Found it on
http://discussions.citrix.com/topic/300865-xenserver-60-and-autostart-vm-on-server-boot-another-solution-within-xencenter/
This post:


Wojciech Bachowski Members

* <http://discussions.citrix.com/topic/300865-xenserver-60-and-autostart-vm-on-server-boot-another-solution-within-xencenter/#entry1677077>

* #14

*
* 5 posts

Posted 01 October 2012 - 09:51 PM

Hi Albert I have version 6.0.2 and machines are starting automatically
without any problems.

You can also try to start your vms using vApp:
1. Create vApp.
2. Choose vms to vApp.
3. Choose boot order and delays between starts.
4. Use xe appliance-list name-label="name-vapp" to get uuid of vApp.
5. Use vi /etc/rc.local to open rc.local file.
6. At the end of the file past:
sleep 40
xe appliance-start uuid=uuid-vapp
7. Save file, reboot XenServer.

Now your vApp will start with XenServer and will start vms inside in
chosen order.



--
Morten Christensen
Re: Autostart with XCP on Debian 7 [ In reply to ]
I did read that vApp, but at the time didn't try it because it added
complexity to the mix.

I think, effectively does what I did but offers a bit more control over
start-up timing etc. I may look at doing that instead and see if it
improves the boot-up load as currently I'm kicking off both my dev VMs side
by side and it's hammering the poor Dev server (HP Microserver) very hard
from an IO perspective. I imagine with a bigger machine with more VMs
that's going to start causing startup speed issues on reboots.

One thing I noticed is the 'xe start-vm' process doesn't drop to the
background upon being called in rc.local. Would it do nay harm to redirect
it to background by suffixing '&&' on the end? Or am I better off rolling a
proper init.d file for it and using the init system correctly?

Thanks,

--

Mark