Page 1 of 1

Autostart for VM

Posted: Tue Jul 17, 2012 4:35 pm
by chemil
Hello, is there any "autostart" parameter for VMs virtualized on KVM inside RouterOS?
After router reboot all VMs are waiting for manual start.

Solution alredy exist on stadard linux KVM "virsh autostart vmName"
Thank you in advance

Re: Autostart for VM

Posted: Wed Aug 01, 2012 9:07 am
by janisk
guests should be started after the reboot of the host. What version and what guest you are running that is not started on reboot?

Re: Autostart for VM

Posted: Fri Aug 03, 2012 12:17 pm
by chemil
The router is currently running v5.9 on x86.
Guest OS is Ubuntu 10.04.4 LTS

Re: Autostart for VM

Posted: Fri Aug 03, 2012 12:25 pm
by janisk
try newer RouterOS release. Latest should start guest on boot-up if guest was running before reboot/shut-down.

Re: Autostart for VM

Posted: Fri Aug 03, 2012 1:56 pm
by chemil
After router reboot with the latest RouterOS (v5.19) my VM has only "vnc cant bind" in the status and it is necessary to start it manually

Re: Autostart for VM

Posted: Fri Aug 03, 2012 1:57 pm
by janisk
how you have configured your guest entry in /kvm menu. Maybe you can post here so we could see the parts regarding VNC.

Re: Autostart for VM

Posted: Fri Aug 03, 2012 2:03 pm
by chemil
[admin@XXXX] > kvm print
Flags: X - disabled
0 name="VM" cpu-count=2 memory=512MiB
disk-images=hda:ubuntu.img,cdrom:ubuntu-10.04.3-server-i386.iso kernel=""
kernel-cmdline="console=ttySO" initrd="" vnc-server-address=192.168.80.1
vnc-server-display=1 snapshot=no state=running

Re: Autostart for VM

Posted: Fri Aug 03, 2012 3:48 pm
by janisk
do this address exists on the router
 vnc-server-address=192.168.80.1
on on what interface it is assigned? You could try to create empty bridge interface and assign address on it and try to bind vnc on that address or set this attribute value to 0.0.0.0 so it will accept connections on all available ip addresses on the router.

Re: Autostart for VM

Posted: Mon Aug 06, 2012 8:37 pm
by chemil
Yes, this IP address belongs to ether2 however I did exactly what you suggested.
I changed vnc-server-address to 0.0.0.0 and now the VM starts after reboot automatically.

Thank you for your support!

Re: Autostart for VM

Posted: Tue Aug 07, 2012 9:26 am
by janisk
what interface is that, as only thing i can think of - at the time when KVM starts its guests - interface is not there as result, IP address is invalid and KVM cannot bind VNC to that ip address.

Re: Autostart for VM

Posted: Tue Aug 07, 2012 10:11 am
by chemil
It's one interface of QuadGigabit Ethernet PCI-Express card from Supermicro (S9AOCSGI4). It has an Intel 82571EB chipset.

Re: Autostart for VM

Posted: Tue Aug 07, 2012 10:15 am
by janisk
and is the address static or assigned dynamically.

Re: Autostart for VM

Posted: Tue Aug 07, 2012 12:11 pm
by chemil
The IP address is static

Re: Autostart for VM

Posted: Tue Aug 07, 2012 12:37 pm
by janisk
thank you for additional information.

Re: Autostart for VM

Posted: Tue Aug 07, 2012 2:17 pm
by chemil
I thank you janisk.

It might be also related to link establishment delay between router NIC and switch. I'm using WS-C2960S-24TS-L switch here and I'm sure that it has auto-negotiation configured on all ports.
It might be worth to try set up link speed and duplex manualy on these ports and on both devices and redo this test with the previous config.

Let me know if you are interested in the result of such a test because for me yours solution is sufficient enough.

Re: Autostart for VM

Posted: Tue Aug 07, 2012 2:50 pm
by janisk
if that is gigabit link you have to have auto-negotiation enabled for the port since gigabit is negotiating not only link speed and duplex as that was for Fast Ethernet interfaces. We will check what we can do with links that could become active later on and thus force guest to fail, since address is not ready to be bind()ed to.