Jump to content

Recommended Posts

Posted

Hi All,

 

I installed UPS monitoring application on one guest vm and now I want to shutdown all virtual machines and then host when power goes off or any specific event occurs.

I installed VMware ESXi 4.0 server as host and different guest VM(Linux,Windows,Unix) on host.Now I want to shutdown all virtual machines which are running on server and then ESXi host.

 

So how can I do it.

 

Thanks in advance.

Posted

I am newbie in VMware and we need not to use vSphere Command-Line Interface or vMA.

Is there any way that I can fire it from ESXi server?

Posted
I am newbie in VMware and we need not to use vSphere Command-Line Interface or vMA.

Is there any way that I can fire it from ESXi server?

 

I wouldn't have thought so, no. At least not any supported way I can think of since the Tech Support console isn't meant to be used.

 

Can I ask why you're not meant to use the management tools which VMWare recommend?

Posted

Thanks for reply.

I have developed it with vMA and able to shutdown as required but now I want to do the same with other option.So please provide me other options which can perform the same task.

I will appreciate if you can provide me the script also.

Posted

OK.. Now If I want to monitor the UPS via ESXi server and when power goes off or any event occers then it should do the following things-

i) shutdown all vm running on ESXi server.

ii) shutdown ESXi host also.

 

How can I achieve it.

Posted
OK.. Now If I want to monitor the UPS via ESXi server and when power goes off or any event occers then it should do the following things-

i) shutdown all vm running on ESXi server.

ii) shutdown ESXi host also.

 

How can I achieve it.

 

You can't - you need a separate box (or VM) monitoring the UPS and ready to send the commands to ESXi.

 

Remember, ESXi doesn't have a kernel, or even an OS, other than a very, very limited tech support console with a scattering of commands which isn't intended to be used to manage the server.

Posted (edited)

I installed vmware vSphare CLI on guest VM(Windows7) and when I am trying to run--

vicfg-hostops.pl -a poweroff -o shutdown -d Name of your ESXi server -f

 

getting the following error--

 

'vicfg-hostops.pl' is not recognized as is not recognized as an internal or external command,operable program or batch file.

Edited by Vanit
Posted (edited)

vSphere CLI installer installs both the vSphere CLI and vSphere SDK for Perl. So I dont think to install active perl externally.

When I am typing the following command-

 

C:\Program Files\VMware\VMware vSphere CLI\Perl\apps>perl -v

 

This is perl, v5.8.8 built for MSWin32-x86-multi-thread

(with 50 registered patches, see perl -V for more detail)

Copyright 1987-2006, Larry Wall

 

and when I am trying to execute other commands like-

 

C:\Program Files\VMware\VMware vSphere CLI\bin>esxcfg-nas.pl --server ESXi server address here --list

 

it is working fine and I am also able to see this file in bin directory but I didn't found vicfg-hostops.pl file anywhere in the directory.

 

Please let me know what is going wrong here and how to resolve it.

Edited by Vanit
Posted (edited)

Thanks a lot for support....As per your suggestion, I reinstall it and now I am able to execute most of the scripts.

 

 

but this is useful for shutting down ESXi server from guest VM which is not my requirement.

 

My requirement is to shutdown all guest from ESXi server and then server itself.so how can I make it?

Edited by Vanit
  • 6 months later...
Posted

Vanit,

 

I have used this to first shutdown my vm guests, then ESXi hosts. You must have the -f or --force to enable shutdown of a host not in maintenance mode.

 

vicfg-hostops.pl -o shutdown -f -a poweroff --server --username --password

 

I know this is an older post but this may help others in the future.

 

I also have one unanswered piece of this puzzle that someone maybe can help with. Does the "-a poweroff" gracefully shutdown the vm guests or does it "cut the power" to the vm guests? -if anyone can answer that it would be an added bonus.

 

Thanks!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...