VMware Cloud Community
citlali
Contributor
Contributor
Jump to solution

ESX powerdown possible from VIMA?

Ok, since your very helpful responses yesterday (http://communities.vmware.com/message/1252435#1252435), my colleague and I have installed VIMA on our server. I have the VMware Infrastructure Client open, and at localhost.localdomain I can start and stop VIMA and a Linux Fedora 8 Virtual Machine.

We have also tested Tripp Lite PowerAlert Local (PAL) software installed to VIMA, using an internal release candidate. The UPS I have connected right now is just connected through the only serial port on the unit. My VMware Infrastructure Client does not give me the option to add a USB interface to VIMA, so I cannot connect a UPS that way. Monday or Tuesday we will probably also test our Power Alert Shutdown Agent + SNMP Webcard combination as well. Is there a compelling reason why users would not want to consider connecting a UPS via the serial connection on the server?

I have added the scripts from William Lam on VIMA, and I am running the upsVIShutdown.pl from the command line. This works to first shutdown my Linux Fedora 8 VM and then my VIMA, but the ESX server box never powers down. Should I expect that the ESX server will power down when the script is run from VIMA? Are the scripts usually installed on VIMA or on the ESX console? I guess I am missing something about powering down the entire box from VIMA after the VMs are safely turned off.

Thanks,

Xochitl Lunde-Monzón

Tripp Lite Software Engineer

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

So it looks like you still got some resolution issues with the displayname of what your VIMA VM is really called.

First off, lets verify the host or/IP you've added your_ESXi_ host into VIMA, you can verify this by doing the following:

[vi-admin@vima ~]$ sudo vifp listservers
Password:
himalaya.primp-industries.com

You should get back your ESXi host, now if you do I want you to do the following:

[vi-admin@vima ~]$ vifpinit himalaya.primp-industries.com

again, substitute whatever was from the initial command to see if vifpinit would execute and make sure no errors occur. If this is good so far, then I want you to run the next command:

 /usr/lib/vmware-viperl/apps/vm/vminfo.pl --server himalaya.primp-industries.com | grep Name

This will print out the VM(s) currently residing on your ESXi host and will provide you with the displayName which is the same name as you would see in the VI Client.

I suspect you just have a bad name somewhere on what you think is the actual name to what is actually being stored.

Also you may want to remediate the issue where the host shows up as 'localhost.localdomain' by going to host configuration->DNS and Routing and make sure all that information is setup properly

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos
9 Replies
lamw
Community Manager
Community Manager
Jump to solution

The script utilizes the VI Perl Toolkit which are Perl bindings to the VI SDK which are installed and located on VMware VIMA, the script is not executed/stored on the ESX(i) themselves. The reason we can run these scripts on VIMA is because the host(s) are being managed by VIMA through vifp and utilizing the vi-fastpass lib, it does not require you to provided additional credentials.

The shutdown is being called with ShutdownHost_Task() http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/vim.HostSystem.html#shutdo... and that is to just shutdown the ESX(i) system but not power down AFAIK, once you restore power you can then power on the host again.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

If you find this information useful, please award points for "correct" or "helpful".

citlali
Contributor
Contributor
Jump to solution

After my Linux Fedora 8 VM and then my VIMA shutdown, the service console is still running and happy. The VMware Infrastructure Client doesn't appear to lose communication with the ESX server either. Do you mean that so long as all VMs and VIMA shutdown, it is typical or OK to just let the ESX server lose power ( either from UPS battery drain or shedding the ESX server load ) ?

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

Something must have happened, it should have shutdown all VM(s) and the VM that is running the shutdown script, in this case your VIMA VM will not be powered off since it's kicking off the script. Once the script has verified all VM(s) are down, it'll send the shutdown host command and using the force flag because by default a host will not shutdown if it still has running VM(s), but in a situation like this, you can shutdown the host and VIMA VM is not of great importance. It looks like something might have not been configured, did you set the displayName of your VIMA VM in the configuration to ensure that VM does not get shutdown? Else, that may be why your host is still running

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

If you find this information useful, please award points for "correct" or "helpful".

citlali
Contributor
Contributor
Jump to solution

I certainly tried to set it correctly, but I maybe did not. Is the displayname the same as the hostname or something else? I set my hosts a few different ways, most recently like this (which I think is not right):

my @hosts = ("linuxhost.trippdomain.local", "esx.trippdomain.local", "TLVIMA")

linuxhost.trippdomain.local would be the fedora 8 host,

esx.trippdomain.local would be the "hostname" displayed when you type "hostname" at the service console

TLVIMA would be "hostname" of the VIMA.

I know this can't be right to put the hostname of the service console before the VIMA, but I just tried some things. /sigh this problem is very newb, sorry.

0 Kudos
citlali
Contributor
Contributor
Jump to solution

If I don't have "esx.trippdomain.local" somewhere in the list, nothing at all happens if I launch the upsShutdown Perl script from the VIMA command line.

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

Please re-read the documentation carefully: http://communities.vmware.com/docs/DOC-9531

As explained, there are few variables you need to populate, one which defines the host(s) or ESX/ESXi Servers and one that defines your VIMA vApp that is the VM that is reading from your UPS and also the system that is kicking off the shutdown process, because this utilizes vi-fastpass, you MUST use VMware VIMA to do this.

Your ESX/ESXI host goes here, please ensure the hostname/IP is resolvable by your VIMA VM (ensure proper DNS is configured)

my @hosts = ("superion.primp-industries.com","devastator.primp-industries.com");

Your VIMA VM goes here (VM displayname)

my $ups_vm_name = "VIMA-UPS-DEV";

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
citlali
Contributor
Contributor
Jump to solution

Thanks for your patience. I have re-read your webpage. I think previously I was looking at a different instruction set instead (). I changed my script so the only host in the list is the "esx.trippdomain.local", which is the resolvable hostname displayed by the ESX service console. My VIMA shows the command line prompt "vi-admin@TLVIMA", so my ups_vm_name is "TLVIMA".

I run the script from the VIMA command line. $> ./upsVIShutdown.pl

The result is that all VMs on this host go offline, as viewed in VMware Infrastructure Client. My VIMA console shows a broadcast message from root saying the system is shutting down, and then all the printouts of the services shutting down. My sec_to_sleep is 25.

The VMware Infrastructure Client never loses communication. From VMware Infrastructure Client, I restart VIMA and look at the /tmp/upsShutdown.log. This log is empty, which is not what I expected.

EDIT: One other thought. When I look at this server using VMware Infrastructure Client, the name of the server shows up as "localhost.localdomain" in the Inventory list. Should this be matching the name "esx.trippdomain.local" which the DNS server knows and the VIMA knows (using sudo vifp listservers) ?

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

So it looks like you still got some resolution issues with the displayname of what your VIMA VM is really called.

First off, lets verify the host or/IP you've added your_ESXi_ host into VIMA, you can verify this by doing the following:

[vi-admin@vima ~]$ sudo vifp listservers
Password:
himalaya.primp-industries.com

You should get back your ESXi host, now if you do I want you to do the following:

[vi-admin@vima ~]$ vifpinit himalaya.primp-industries.com

again, substitute whatever was from the initial command to see if vifpinit would execute and make sure no errors occur. If this is good so far, then I want you to run the next command:

 /usr/lib/vmware-viperl/apps/vm/vminfo.pl --server himalaya.primp-industries.com | grep Name

This will print out the VM(s) currently residing on your ESXi host and will provide you with the displayName which is the same name as you would see in the VI Client.

I suspect you just have a bad name somewhere on what you think is the actual name to what is actually being stored.

Also you may want to remediate the issue where the host shows up as 'localhost.localdomain' by going to host configuration->DNS and Routing and make sure all that information is setup properly

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
citlali
Contributor
Contributor
Jump to solution

Thanks, now that VIMA name is correct, the script is working. We will test this more on Monday, and I also want to test it with the publicly-available software RPM instead of the release candidate. Cheers!

Xochitl Lunde-Monzón

Tripp Lite Software Engineer

0 Kudos