@michmoor0725 Did you ever found a solution? I have the same problem. I think it has someting to do with running it on a remote NAS. @Andrew you linked the same post we're in. Was this your intention? Or is there another post on this topic i didn't find?
Posts made by Hannes_5253
-
RE: Delta backups failing
-
RE: Delta Backups using wrong Base Backup
@Andrew okay now I understand! Thanks a lot!!!
-
Delta Backups using wrong Base Backup
Hey there,
I encountered following:
My Full Backup interval is 28 and my Backup Retention is 29. But after the new Full Backup interval began and the new full backup was created the next delta backup seems to point the old full Backup. Why do I think so?- The old Full Backup was not deleted on the remote although it dissappeared in XOA.
- The latest change date of the old full Backup is AFTER the new full backup.
Remote Files:
XOA available Restore Backups
Is this something to worry about? I'm afraid of deleting the old Full Backup.
If this is an error: How to solve this? -
RE: Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2
@odeawan Sure but you need a nut server. When you use the XCP-NG Server as a client you have to install the nut server on a different system. You can't install the nut server on a vm on the same host because the nut server must be installed on a system to shut down last.
So running this scenario is the most redundant and efficient way. -
Restore Delta Backup with Full Backup created afterwards
Hey there,
How should I configure the Backup Retention when using Delta Backup and a Full Backup Interval of 20? When I set the Backup Retention to 21 and the Full Backup gehts deleted after the 22th Backup: Can I restore the Delta Backups with the Full Backup taken AFTER the Delta Backups or will all Backups in the chain before the new Full Backup be useless after deleting the initial Full Backup?Greetings and thanks in advance.
-
RE: Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2
@lknite Glad I could help and I agree.
-
RE: Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2
@olivierlambert
I wrote down the to-dos. You can use it for the official docs if you like! When you have questions, just answer on this Post.Network UPS Tools
Installation on XCP-ng HostAt first: Connect your UPS.
Then run this commands to install NUT:yum update yum –enablerepo=* install epel-release yum install nut yum install nut-client cd /etc/ups wget https://github.com/serrc-techops/NUT-Configuration/blob/master/slave/xen/xen-shutdown.sh chmod +x xen-shutdown.sh
Important Commands
-
upsc apcups (check UPS connection)
-
systemctl restart nut-server
(NUT-server reboot) | (Use this to apply configuration changes and to connect the UPS after System startup) -
systemctl restart nut-monitor (NUT-monitor restart)
-
nut-scacnner -U (shows connected devices)
Configure the files stored in /etc/ups like this:
upsmon.confRUN_AS_USER root MONITOR apcups@localhost 1 admin [PASSWORD] master SHUTDOWNCMD „/etc/ups/xen-shutdown.sh“
nut.conf
MODE=netserver
ups.conf
pollinterval = 1 maxretry = 3 [apcups] driver = usbhid-ups #->when you use USB devices port = auto desc = „[NAME]“ vendorid = [VENDORID] productid = [PRODUCTID] serial = „[SERIALNO]“
upsd.conf
LISTEN 0.0.0.0 3493
upsd.users
[admin] password = [PASSWORD] actions = set actions= fsd instcmds = ALL
Finish config Changes
systemctl restart nut-server systemctl restart nut-monitor
Finished
Good to know: You can now also connect to your NUT server via the pfSense plugin by using the credentials in uspd.users to have a gui for your UPS. To do this you have to open up Port 3493 on your host.
Run this command to open the Port:iptables -I INPUT -p tcp -m tcp --dport 3493 -j ACCEPT
Then save your changes to a config file and adjust Year, Month and Day in the config name. In my case it's the 22th of december in 2022:
iptables-save > /etc/sysconfig/iptables mkdir /etc/iptables/ iptables-save > /etc/iptables/rules_2022-12-22_INPUT_ACCEPT_3493_NUT.v4 --> Optional, extra saving for Backups.
I recommend using this convention of naming your rule files. Its a lot easier to track your changes and to restore files.
-
-
RE: Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2
@olivierlambert Oh man, only saw this answer because I went back to my old post. I will do a full guide when I have some time and send it to you.
-
RE: Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2
@peek said in Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2:
yum --enablerepo=* install nut.x86_64
This video solved it for me (altough its in german)
YouTube TutThread can be closed.
-
RE: Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2
@aimdev thanks for the information!
-
RE: Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2
@peek Thanks for the answer! I did this. I have to take another look at the configuration.
-
RE: Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2
@peek said in Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2:
@hannes_5253 Any reason for not prefering to run the NUT server directly on the XCP-NG host ?
I didn't got it with the Host, maybe I'm too stupid.
-
RE: Increasing the size of a disk
I can recommend gparted to resize your partions. It's easy and has a GUI.
Important: you can't resize the boot partition without a live ISO. -
RE: Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2
I found this post:
https://voice1.me/automated-shutdown-xenserver-7-x-with-network-ups-tool/I just used the Driver type for USB: usbhid-ups
You can find the correct driver type for your system here:
https://networkupstools.org/stable-hcl.htmlHere is the guide for USB (partly copied from the article):
IMPORTANT: The way I made is is not recommend! Your pfSense should normally not run on a VM using this method but it still works. It's recommended to use a physical pfSense to perform this setup.
Requirement:
- a VM running pfSense
- all VMs on your XCP-ng host have to run guest gtilities.
- a USP with USB Connection
- XCP-ng Center
- Connecting the USP to a VM via USB
- Plug-in the USP via USB into the Server
- Enable USB-passthrough in the USB Tab of your Host (XCP-ng Center)
- Shutdown the pfSense, attach the USB device to the pfSense VM in the Properties Tab of the VM
- Start the VM
- Installing NUT
If you are using pfSense, you can install nut from the Package Manager. Once installed you will be able to access the setup from Services > UPS.
- Select “Local USB” from the UPS Type and provide a UPS Name.
- add this to your uspd.conf:
ACL all 0.0.0.0/0 ACCEPT all
- add this to your uspd.users:
[(YOUR USERNAME)] password = (YOUR PASSWORD) allowfrom = all instcmds = ALL
Attention! The username has to be written with the brackets! ie: [admin]
- click on save and pfSense should now detect your UPS and give you its information in the UPS Dashboard.
- Configure the XCP-ng host as NUT slave (pfSense is master)
- By default the built in repository does not have the required library, so we need to enable the epel repository before we can install the nut-client
yum --enablerepo=* install epel-release yum --enablerepo=* install nut-client.x86_64
- Now we need to tell NUT that we want it to listen to an existing NUT Server, in other words, we want to be a “client”.
nano /etc/ups/nut.conf MODE=netclient
- Now that NUT knows it will be retrieving information from another network server, we need to tell it what network server to “MONITOR”. You will need to modify only 2 variables in the file /etc/ups/upsmon.conf but take a look around because you can tweak how the NUT Client responds by modifying the settings in this file. For now, lets just tell NUT where to retrieve its information from.
nano /etc/ups/upsmon.conf MONITOR (NAME OF YOUR UPS)@(PFSENSE IP) 1 (USERNAME) (PASSWORD) slave SHUTDOWNCMD "/etc/ups/xen-shutdown.sh"
- You probably already have a SHUTDOWNCMD in your configuration Just add a comment “#” to the start of the line and add the one provided above. Speaking of the SHUTDOWNCMD, you will notice that we are calling a specific script. This script can be downloaded here.
cd /etc/ups wget https://raw.githubusercontent.com/serrc-techops/NUT-Configuration/master/slave/xen/xen-shutdown.sh chmod +x xen-shutdown.sh
!!! I wasn't able to perform the next step because the service started to fail afterwards!!!
The shutdown still works. I try to figure out a solution and add it here.So on a power failure, the NUT Master sends a message to all subscribed NUT Clients, and the NUT Client shuts down based on its configuration. Wonderful Now our Xen Guests can shutdown, and so can our server. But what happens when we power them back up? We need to make sure that NUT starts on our XenServer.
- To do so create a new file, /etc/systemd/system/nut-monitor.service and add the following to it.
[Unit] Description=Network UPS Tools - XenServer Shutdown After=local-fs.target network.target [Service] ExecStart=/usr/sbin/upsmon PIDFile=/run/nut/upsmon.pid Type=forking [Install] WantedBy=multi-user.target
Now that we have a system startup script in place, lets make sure it runs on start up.
systemctl enable nut-monitor.service systemctl daemon-reload systemctl start nut-monitor
- Testing shutdown
- Execute this command in the Shell of your pfSense:
This will simulate a power cut!!!
upsmon -c fsd
If you have any questions ask me below.
There is one problem: you have to reattach the USB to the VM after every host reboot!
-
Performing automated shutdown during a power failure using a USB-UPS with NUT - XCP-ng 8.2
Hey there,
I have a very specific question:
Is there a way to get PowerChute running on a XCP-ng Host? I already found this article from Citrix:
https://support.citrix.com/article/CTX119910
and this from APC:
https://www.apc.com/us/en/faqs/FA159764/The problem is I don't have a Network Management Card installed or the possibility of adding one. I'm dependent on a USB Connection. So I was wondering how I can configure a shutdown of all VMs and the Host with a USB Connection? It's important for me to understand the process. Do I need an seperate PC to manage this? Is there a solution with USB passthrough and one VM executes a shutdown script on the Host? I would be thankful on some help/related articles or anything you can give me to figure it out myself.
I'm running on XCP-ng Version 8.2 an I have a APC Back-UPS 700.