It is currently Sat May 27, 2017 12:56 am
All times are UTC + 8 hours

[HOWTO] start and stop VM with your NAS.

Just about everything is virtual these days. Topics relating to virutalization go here.

Re: [HOWTO] start and stop VM with your NAS.

Postby sksbir » Mon Apr 10, 2017 3:14 pm

Hi

Code: Select all
VBoxManage list runningvms
gives you the running VMS.
sksbir
 
Posts: 161
Joined: Tue Aug 25, 2015 9:23 pm

Re: [HOWTO] start and stop VM with your NAS.

Postby duffoy » Tue Apr 11, 2017 11:12 pm

Thank you sksbir,

I know this command but what I looking for is a way to control in Logfile etc...to check if a VMs is really shut down gracefully or not.
If you testing the whole installation I think this is a important thing.
The first VM I used is working great, whit the 2 something is weird so have to check this.
Think the script is not used.
Is there a other limitation in /usr/local/etc/init.d/ of the certain levels I can use.
For shutdown I want use K47-K49 and for start the VM's S97-S99.

Best D.
duffoy
 
Posts: 13
Joined: Mon Jan 30, 2017 9:28 pm

Re: [HOWTO] start and stop VM with your NAS.

Postby sksbir » Fri Apr 21, 2017 4:27 am

duffoy wrote:Thank you sksbir,

I know this command but what I looking for is a way to control in Logfile etc...to check if a VMs is really shut down gracefully or not.
If you testing the whole installation I think this is a important thing.
The first VM I used is working great, whit the 2 something is weird so have to check this.
Think the script is not used.
Is there a other limitation in /usr/local/etc/init.d/ of the certain levels I can use.
For shutdown I want use K47-K49 and for start the VM's S97-S99.

Best D.

maybe you are right. I could not determine if NAS shutdown let enough time to VM to shutdown properly. To be sure, I use scheduler from VM OS to shutdown VM gracefully, and after that, use scheduler from NAS to reboot : after reboot, VM is brought up again.
sksbir
 
Posts: 161
Joined: Tue Aug 25, 2015 9:23 pm

Re: [HOWTO] start and stop VM with your NAS.

Postby duffoy » Fri Apr 21, 2017 4:37 pm

sksbirwrote:
maybe you are right. I could not determine if NAS shutdown let enough time to VM to shutdown properly. To be sure, I use scheduler from VM OS to shutdown VM gracefully, and after that, use scheduler from NAS to reboot : after reboot, VM is brought up again.


First thank you sksbir, can you describe where and how you setup this...will be great...

Best D.
duffoy
 
Posts: 13
Joined: Mon Jan 30, 2017 9:28 pm

Re: [HOWTO] start and stop VM with your NAS.

Postby sksbir » Fri Apr 21, 2017 5:10 pm

duffoy wrote:
sksbirwrote:
maybe you are right. I could not determine if NAS shutdown let enough time to VM to shutdown properly. To be sure, I use scheduler from VM OS to shutdown VM gracefully, and after that, use scheduler from NAS to reboot : after reboot, VM is brought up again.


First thank you sksbir, can you describe where and how you setup this...will be great...
Best D.

For example:
- my VM is under linux. I use crontab for schedule a shutdown ( without reboot ) , eg at 2.00 in the morning.
- with crontab from NAS, I schedule a reboot at 2.10

For more security, from NAS, you can schedule a script which will check if VM is really stopped, and reboot NAS only if ok, instead of directly schedule shutdown command.
sksbir
 
Posts: 161
Joined: Tue Aug 25, 2015 9:23 pm

Re: [HOWTO] start and stop VM with your NAS.

Postby duffoy » Sun Apr 23, 2017 12:05 am

@sksbir

I understand, but in my case the crontab is not usable.
I shutdown the VM only when the NAS shutdown in case of a signal from the USV or when the NAS is manualy shutdown.
In all other cases the NAS is running 24/7....

Best D.
duffoy
 
Posts: 13
Joined: Mon Jan 30, 2017 9:28 pm

Re: [HOWTO] start and stop VM with your NAS.

Postby Argamas » Sun May 21, 2017 8:49 am

One suggestion if I may... For VMs that could take a considerable amount of time to stop, it may be preferable to save the VM state instead of initiating a full shutdown.
Code: Select all
VBoxManage controlvm $VM_NAME savestate


As a side effect, the startup may be faster since restoring a state is often quicker than a full boot.

Of course, it all depends on what you have in your VMs and what you're doing but.... that could be worth considering.

As how to determine if the VM was shut down properly... The best way is to check the guest operating system. Windows will log an event ID, linux will often log stuff during reboot, because it will detect some filesystems may not have been unmounted correctly, and it will issue an fsck. As an exemple, an Ubuntu 14.04 VM using EXT4 filesystem would log into /var/log/dmesg a line that would look like this;
Code: Select all
EXT4-fs (dm-0): INFO: recovery required on readonly filesystem


A clean reboot where the filesystem has been unmounted correctly won't have that.

I hope this helps... Good luck.
Argamas
 
Posts: 1
Joined: Sun May 21, 2017 8:24 am

Previous

Return to Virtualization

  • You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot post attachments in this forum
  • Who is online

    Users browsing this forum: No registered users and 1 guest