ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    XenServer and APC UPS protection

    IT Discussion
    xenserver ups apc protection vms windows
    4
    25
    4.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DustinB3403D
      DustinB3403
      last edited by

      Hrm... I'll take a look into it.

      1 Reply Last reply Reply Quote 0
      • DustinB3403D
        DustinB3403
        last edited by

        I wonder if APCUPSD works with networked UPS as well..

        As that would be the goal, completely skip USB integration and go to the network.

        travisdh1T 1 Reply Last reply Reply Quote 1
        • travisdh1T
          travisdh1 @DustinB3403
          last edited by

          @DustinB3403 said in XenServer and APC UPS protection:

          I wonder if APCUPSD works with networked UPS as well..

          As that would be the goal, completely skip USB integration and go to the network.

          I think it can, but I haven't set that up. Would be silly to me if it couldn't, but I've seen to many silly missing things in my life already, one more wouldn't be a surprise.

          1 Reply Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403
            last edited by

            Yeah.. my issue is that XS integration with USB means you either have to grant all VM's access to the device, or nothing at all.

            Which is what I'd want to avoid. Having to dedicate a Windows system just to operate XC in the event of losing power, while simple, seems really stupid and expensive, not to mention dangerous has you have to have a system connected to your hosts using the root credentials through XC, but it most likely would be completely un-monitored.

            XO's emergency mode is a good solution, but it requires action from an administrator.

            travisdh1T 1 Reply Last reply Reply Quote 0
            • travisdh1T
              travisdh1 @DustinB3403
              last edited by

              @DustinB3403 said in XenServer and APC UPS protection:

              Yeah.. my issue is that XS integration with USB means you either have to grant all VM's access to the device, or nothing at all.

              Which is what I'd want to avoid. Having to dedicate a Windows system just to operate XC in the event of losing power, while simple, seems really stupid and expensive, not to mention dangerous has you have to have a system connected to your hosts using the root credentials through XC, but it most likely would be completely un-monitored.

              XO's emergency mode is a good solution, but it requires action from an administrator.

              Either you completely missed my point, or I wasn't very clear.

              XenServer shuts down the guests for you, no need for them all to have access to the usb.

              JaredBuschJ DustinB3403D 2 Replies Last reply Reply Quote 1
              • JaredBuschJ
                JaredBusch @travisdh1
                last edited by

                @travisdh1 said in XenServer and APC UPS protection:

                @DustinB3403 said in XenServer and APC UPS protection:

                Yeah.. my issue is that XS integration with USB means you either have to grant all VM's access to the device, or nothing at all.

                Which is what I'd want to avoid. Having to dedicate a Windows system just to operate XC in the event of losing power, while simple, seems really stupid and expensive, not to mention dangerous has you have to have a system connected to your hosts using the root credentials through XC, but it most likely would be completely un-monitored.

                XO's emergency mode is a good solution, but it requires action from an administrator.

                Either you completely missed my point, or I wasn't very clear.

                XenServer shuts down the guests for you, no need for them all to have access to the usb.

                Right, you tell the hypervisor to shut down. Its normal process should already be setup to handle graceful shutdown of the guests.

                1 Reply Last reply Reply Quote 1
                • JaredBuschJ
                  JaredBusch
                  last edited by

                  @DustinB3403 also depending on the model of your UPS, you could go with an Raspberry Pi and either NUT or APCUPSD to monitor the UPS and send the shutdown command to XS.

                  DustinB3403D 1 Reply Last reply Reply Quote 1
                  • DustinB3403D
                    DustinB3403 @travisdh1
                    last edited by

                    @travisdh1 said in XenServer and APC UPS protection:

                    @DustinB3403 said in XenServer and APC UPS protection:

                    Yeah.. my issue is that XS integration with USB means you either have to grant all VM's access to the device, or nothing at all.

                    Which is what I'd want to avoid. Having to dedicate a Windows system just to operate XC in the event of losing power, while simple, seems really stupid and expensive, not to mention dangerous has you have to have a system connected to your hosts using the root credentials through XC, but it most likely would be completely un-monitored.

                    XO's emergency mode is a good solution, but it requires action from an administrator.

                    Either you completely missed my point, or I wasn't very clear.

                    XenServer shuts down the guests for you, no need for them all to have access to the usb.

                    No I didn't miss the point, the official way to do this from Citrix is to dedicate a physical windows system. That was my point.

                    travisdh1T 1 Reply Last reply Reply Quote 0
                    • DustinB3403D
                      DustinB3403 @JaredBusch
                      last edited by

                      @JaredBusch said in XenServer and APC UPS protection:

                      @DustinB3403 also depending on the model of your UPS, you could go with an Raspberry Pi and either NUT or APCUPSD to monitor the UPS and send the shutdown command to XS.

                      I considered this, but don't have any to work with.

                      1 Reply Last reply Reply Quote 0
                      • travisdh1T
                        travisdh1 @DustinB3403
                        last edited by

                        @DustinB3403 said in XenServer and APC UPS protection:

                        @travisdh1 said in XenServer and APC UPS protection:

                        @DustinB3403 said in XenServer and APC UPS protection:

                        Yeah.. my issue is that XS integration with USB means you either have to grant all VM's access to the device, or nothing at all.

                        Which is what I'd want to avoid. Having to dedicate a Windows system just to operate XC in the event of losing power, while simple, seems really stupid and expensive, not to mention dangerous has you have to have a system connected to your hosts using the root credentials through XC, but it most likely would be completely un-monitored.

                        XO's emergency mode is a good solution, but it requires action from an administrator.

                        Either you completely missed my point, or I wasn't very clear.

                        XenServer shuts down the guests for you, no need for them all to have access to the usb.

                        No I didn't miss the point, the official way to do this from Citrix is to dedicate a physical windows system. That was my point.

                        They must have a reason for it, but, why? Just, why? Is this another "Software RAID is bad" scenario from them?

                        DustinB3403D 1 Reply Last reply Reply Quote 0
                        • DustinB3403D
                          DustinB3403 @travisdh1
                          last edited by

                          @travisdh1 said in XenServer and APC UPS protection:

                          @DustinB3403 said in XenServer and APC UPS protection:

                          @travisdh1 said in XenServer and APC UPS protection:

                          @DustinB3403 said in XenServer and APC UPS protection:

                          Yeah.. my issue is that XS integration with USB means you either have to grant all VM's access to the device, or nothing at all.

                          Which is what I'd want to avoid. Having to dedicate a Windows system just to operate XC in the event of losing power, while simple, seems really stupid and expensive, not to mention dangerous has you have to have a system connected to your hosts using the root credentials through XC, but it most likely would be completely un-monitored.

                          XO's emergency mode is a good solution, but it requires action from an administrator.

                          Either you completely missed my point, or I wasn't very clear.

                          XenServer shuts down the guests for you, no need for them all to have access to the usb.

                          No I didn't miss the point, the official way to do this from Citrix is to dedicate a physical windows system. That was my point.

                          They must have a reason for it, but, why? Just, why? Is this another "Software RAID is bad" scenario from them?

                          Yeah I don't know, the ups monitoring solution is use a Windows system, install the software and connect xencenter to your servers.

                          DustinB3403D 1 Reply Last reply Reply Quote 0
                          • DustinB3403D
                            DustinB3403 @DustinB3403
                            last edited by

                            @DustinB3403 said in XenServer and APC UPS protection:

                            @travisdh1 said in XenServer and APC UPS protection:

                            @DustinB3403 said in XenServer and APC UPS protection:

                            @travisdh1 said in XenServer and APC UPS protection:

                            @DustinB3403 said in XenServer and APC UPS protection:

                            Yeah.. my issue is that XS integration with USB means you either have to grant all VM's access to the device, or nothing at all.

                            Which is what I'd want to avoid. Having to dedicate a Windows system just to operate XC in the event of losing power, while simple, seems really stupid and expensive, not to mention dangerous has you have to have a system connected to your hosts using the root credentials through XC, but it most likely would be completely un-monitored.

                            XO's emergency mode is a good solution, but it requires action from an administrator.

                            Either you completely missed my point, or I wasn't very clear.

                            XenServer shuts down the guests for you, no need for them all to have access to the usb.

                            No I didn't miss the point, the official way to do this from Citrix is to dedicate a physical windows system. That was my point.

                            They must have a reason for it, but, why? Just, why? Is this another "Software RAID is bad" scenario from them?

                            Yeah I don't know, the ups monitoring solution is use a Windows system, install the software and connect xencenter to your servers.

                            Which to me seems insane, the hypervisor should support this without the need to use a Windows system.

                            Although it's simple, it just seems like a poor solution.

                            JaredBuschJ 1 Reply Last reply Reply Quote 1
                            • JaredBuschJ
                              JaredBusch @DustinB3403
                              last edited by

                              @DustinB3403 said in XenServer and APC UPS protection:

                              @DustinB3403 said in XenServer and APC UPS protection:

                              @travisdh1 said in XenServer and APC UPS protection:

                              @DustinB3403 said in XenServer and APC UPS protection:

                              @travisdh1 said in XenServer and APC UPS protection:

                              @DustinB3403 said in XenServer and APC UPS protection:

                              Yeah.. my issue is that XS integration with USB means you either have to grant all VM's access to the device, or nothing at all.

                              Which is what I'd want to avoid. Having to dedicate a Windows system just to operate XC in the event of losing power, while simple, seems really stupid and expensive, not to mention dangerous has you have to have a system connected to your hosts using the root credentials through XC, but it most likely would be completely un-monitored.

                              XO's emergency mode is a good solution, but it requires action from an administrator.

                              Either you completely missed my point, or I wasn't very clear.

                              XenServer shuts down the guests for you, no need for them all to have access to the usb.

                              No I didn't miss the point, the official way to do this from Citrix is to dedicate a physical windows system. That was my point.

                              They must have a reason for it, but, why? Just, why? Is this another "Software RAID is bad" scenario from them?

                              Yeah I don't know, the ups monitoring solution is use a Windows system, install the software and connect xencenter to your servers.

                              Which to me seems insane, the hypervisor should support this without the need to use a Windows system.

                              Although it's simple, it just seems like a poor solution.

                              Does a shutdown command to XS from an SSH session initiate the guest shutdowns?

                              If so, any UPS monitor tool will work because they can all initiate commands.

                              DustinB3403D 1 Reply Last reply Reply Quote 0
                              • DustinB3403D
                                DustinB3403 @JaredBusch
                                last edited by

                                @JaredBusch Yes SSH works to shutdown a host and guest.

                                BRRABillB 1 Reply Last reply Reply Quote 0
                                • BRRABillB
                                  BRRABill @DustinB3403
                                  last edited by

                                  @DustinB3403

                                  This is what I started playing with. Have you seen this yet?

                                  Comes with a script and everything.

                                  https://pantsmanuk.org/2015/04/apcupsd-running-on-citrix-xenserver-7-0/

                                  DustinB3403D 1 Reply Last reply Reply Quote 0
                                  • DustinB3403D
                                    DustinB3403 @BRRABill
                                    last edited by

                                    @BRRABill said in XenServer and APC UPS protection:

                                    @DustinB3403

                                    This is what I started playing with. Have you seen this yet?

                                    Comes with a script and everything.

                                    https://pantsmanuk.org/2015/04/apcupsd-running-on-citrix-xenserver-7-0/

                                    I haven't seen that, but I will definitely take a look, nice find.

                                    1 Reply Last reply Reply Quote 0
                                    • DustinB3403D
                                      DustinB3403
                                      last edited by DustinB3403

                                      Here is the original article that PantsManUK converted for his installation. The article is from 2013, so it is is out of date. This is very much worth trying. If I get the chance I'll test it in my lab at home.

                                      Quoted from with pertinent parts highlighted from

                                      Citrix Xenserver does not include UPS / UPS services or setting options.

                                      The Windows version:

                                      From a host with Xencenter installed, The following command posted to shut down a VM:

                                      Xe.exe -s <XenServer-IP> -u root -pw password vm-shutdown vm = VM name
                                      However, why should a VM host system be dependent on another Windows host for a shutdown in case of power failure?

                                      My conclusion: NOT recommended, if UPS can be operated directly at the Xenhost (USB, Network or Serial connection)

                                      The Linux variant:

                                      In Linux, the apcupsd solution is called , which is actually contained in each distribution, or can be installed by repository. Stupid only the Xenserver (stripped down CentOS) is not the case. However, it is possible to manually install and customize the RPM package from the official CentOS repository on the Xenserver. However, in order to shut down the VM guests, mail notification, message in the Xencenter, several steps, more precisely script adaptions are required.

                                      Apcupsd at the Xenserver, an overview:

                                      Apcupsd, Daemon from CentOS
                                      Apcupsd.conf, customized configuration file, calls vm_shutdown.sh, log entry in Xencenter application.
                                      Vm_shutdown.sh, Shutdown of all VM guests on the local Xenserver (only local VMs if Xenserver in pool !!)
                                      Sendemail, package for simple SMTP sending the UPS status mails
                                      Mailconfigs, changeme; commfailure; commok; offbattery; onbattery; sendemail.conf

                                      Xenserver apcupsd Installation Instructions (Using Tar File):

                                      As always, "at your own risk", the operation of a Linux host with shell commands should be common ๐Ÿ˜‰

                                      1. Download the tar file to the Xenhost

                                      Cd ~
                                      mkdir apc
                                      cd apc`````` wget http://www.flurweg.net/linux/xenserver/apcupsd/xenserver6_apcupsd.tar
                                      2. Unpack files

                                      Tar xvf xenserver6_apcupsd.tar
                                      3. Installing apcupsd

                                      Yum localinstall -nogpgcheck apcupsd-3.14.10-1.el5.i386.rpm
                                      3. Error message in Xenserver version 6.2: Error: Can not find a valid base for repo: citrix

                                      Solution: Open the /etc/yum.repos.d/Citrix.repo file and temporarily disable this repository:

                                      [ 
                                      Citrix ] name = XenServer 6.2.0 updates 
                                      mirrorlist = http: //updates.vmd.citrix.com/XenServer/6.2.0/domain0/mirrorlist #baseurl 
                                      = http: //updates.vmd.citrix.com/XenServer/ 6.2.0 / domain0 / 
                                      gpgcheck = 1 
                                      gpgkey = http: //updates.vmd.citrix.com/XenServer/RPM-GPG-KEY-6.2.0 
                                      enabled = 0
                                      
                                      1. Back up the existing / original configuration files

                                      Mkdir -p /etc/apcupsd/org
                                      cp /etc/apcupsd/ * /etc/apcupsd/org
                                      5. Copy the new configuration files (overwrite: YES [y])

                                      Cp -f /etc/apcupsd/ * /etc/apcupsd/
                                      6. Customize the mail settings in /etc/apcupsd/sendemail.conf

                                      Nano /etc/apcupsd/sendemail.conf
                                      7. Install the Sendemail

                                      Cp usr /bin/sendemail/usr/bin/sendmail
                                      chmod + x /usr/bin/sendemail
                                      8. Testing the notification via e-mail, for example. With:

                                      Sh /etc/apcupsd/changeme
                                      9. Customize the apcupsd.conf configuration

                                      (The included apcupsd.conf is configured for a Smart APC-650 via USB interface)

                                      About apcupsd:

                                      UPS Check communication, output values:

                                      Apcaccess
                                      Configure APC UPS:

                                      Apctest
                                      However, the service has to be terminated before, (do not forget after the configuration!)

                                      /etc/init.d/apcupsd stop
                                      apctest
                                      /etc/init.d/apcupsd start
                                      Other tips:

                                      Xenserver firewall, unblock port:

                                      If you want to read the values โ€‹โ€‹of the UPS connected to the Xenserver (NISIP) from another Linux host with installed CGI-Multimon, the Xenserver firewall stands in the way. You must open Tcp Port 3551 by editing the / etc / sysconfig / iptables file, the line: "-A RH-Firewall-1-INPUT -p tcp -m tcp -dport 631 -j ACCEPT" and Reinsert it. Change the port to 3551 in this copied line:

                                      -A RH firewall-1-INPUT -p tcp -m tcp -dport 3551 -j ACCEPT
                                      Then restart the iptables service:

                                      /etc/init.d/iptables restart
                                      On the Multimon host under /etc/apcupsd/hosts.conf enter the Xenserver IP.

                                      APCUPSD Multimon on Debian host with lighttpd:

                                      Installation:

                                      Apt-get install lighttpd apcupsd-cgi
                                      CGI on lighttpd Enable web server:

                                      Lighty-enable-mod cgi
                                      Cgi-bin Create symlink:

                                      Ln -s /usr/lib/cgi-bin/ /var/www/cgi-bin
                                      Create short line with redirection:

                                      Mkdir /var/www/apc
                                      /var/www/apc
                                      nano index.html
                                      The directory /var/www/apc creates an "index.html" with the following content:

                                      Enter the Xenserver Host into the Multimon Page in the /etc/apcupsd/hosts.conf file:

                                      MONITOR 192.168.8.6 "Xenserver"

                                      travisdh1T 1 Reply Last reply Reply Quote 0
                                      • travisdh1T
                                        travisdh1 @DustinB3403
                                        last edited by

                                        @DustinB3403 That's a lot of stuff to do rather than just fixing the /etc/yum.repos.d/CentOS-Base.repo file. The line

                                        mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
                                        

                                        needs replaced. For XS7

                                        mirrorlist=http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os
                                        

                                        Then you just need to run

                                        yum --enablerepo=base install apcupsd sendmail
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • BRRABillB
                                          BRRABill
                                          last edited by

                                          The link is more recent, because he mention XS 7.

                                          I got acancel AARP (done, should have check by 4/13 and no mailings by 6 weeks from 3/16)I got about 50% of the way into this, and had to move on to other projects. But I really need to get back to it.

                                          1 Reply Last reply Reply Quote 1
                                          • 1
                                          • 2
                                          • 1 / 2
                                          • First post
                                            Last post