An other solution would be a access option to some logging files, so i can calculate the whole timing
All backups log to /var/log/omv-backup-vm.log. There should be a starting and ending event for each one.
An other solution would be a access option to some logging files, so i can calculate the whole timing
All backups log to /var/log/omv-backup-vm.log. There should be a starting and ending event for each one.
All backups log to /var/log/omv-backup-vm.log. There should be a starting and ending event for each one.
wonderful looking into this.....
of course a set it and forget it configuration would be better. But this is a starting point
This log is viewable from the web interface under kvm backups too.
You could also just make a script that runs under scheduled tasks that looks like:
#!/bin/bash
omv-backup-vm -v omv5dev -d /srv/backup/vm/ -k 2 >/dev/null 2>&1
omv-backup-vm -v omv6dev -d /srv/backup/vm/ -k 3 >/dev/null 2>&1
omv-backup-vm -v vm1 -d /srv/backup/vm/ -k 1 >/dev/null 2>&1
omv-backup-vm -v vm2 -d /srv/backup/vm/ -k 1 >/dev/null 2>&1
omv-backup-vm -v vm3 -d /srv/backup/vm/ -k 1 >/dev/null 2>&1
-v is the VM
-d is the backup directory
-k is the number of backups to keep
would this script at the end also lead to the solution that the backups are listed in your plugin areas?
Hi Guys! after installing virt-manager, when i want to create a vm throught web cnsole i see this warning, and cant chose virtual disk to connect to the VM.
Warning:
500 - Internal Server Error Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; virsh vol-list VM's --details | sed 1,2d | awk NF | awk -F '[[:space:]][[:space:]]+' '{ print $1","$2","$4 }'' with exit code '2':
You could also just make a script that runs under scheduled tasks that looks like:
-v is the VM
-d is the backup directory
-k is the number of backups to keep
I've come up with the following script. It's more dynamic and backs up every existing vm. Don't roast me too much, i'm not a dev.
#!/bin/bash
# delete work files
rm /tmp/guests >/dev/null 2>&1
rm /tmp/vmm_export_running >/dev/null 2>&1
rm /tmp/vmm_guests.xml >/dev/null 2>&1
# create list of VMs
virsh list --all > /tmp/vmm_guests.xml
# State File
touch /tmp/vmm_export_running
# trim VM guest list
cat /tmp/vmm_guests.xml |awk 'f;/---/{f=1}' | awk '{print $2}'| tr -d '"' |tr -d ',' >> /tmp/guests
# make backups
while read i; do
mkdir /mnt/VM_Export/$i >/dev/null 2>&1
omv-backup-vm -v $i -d /mnt/VM_Export/$i -k 3 >/dev/null 2>&1
done </tmp/guests
Alles anzeigen
i have one VM which is running fine, but backup isn't working with the plugin. The error isn't reaching the log, it's only viewable via omv GUI.
Because of that, i've added a screenshot
an other, for me new error is, that if the VNC passwords in the VM configs are longer than 8 characters, the plugin has problems (start vm etc.). This was not the case with OMV5 kvm plugin
I've come up with the following script. It's more dynamic and backs up every existing vm. Don't roast me too much, i'm not a dev.
Looks ok to me. This was the one I wrote that I was going to post:
#!/bin/bash
lock="/tmp/omv-kvm-backup"
path="/srv/backup"
if [ -f "${lock}" ]; then
echo "Backup already running. Exiting."
exit 1
fi
# create lock
touch ${lock}
for i in $(virsh list --all | sed 1,2d | awk NF | awk '{ print $2 }'); do
omv-backup-vm -v ${i} -d "${path}" -k 3 >/dev/null 2>&1
done
# delete lock
rm -f ${lock}
echo "Done."
exit 0
Alles anzeigen
Hi Guys! after installing virt-manager, when i want to create a vm throught web cnsole i see this warning, and cant chose virtual disk to connect to the VM.
Warning:500 - Internal Server Error Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; virsh vol-list VM's --details | sed 1,2d | awk NF | awk -F '[[:space:]][[:space:]]+' '{ print $1","$2","$4 }'' with exit code '2':
Can anyone help?
i have one VM which is running fine, but backup isn't working with the plugin. The error isn't reaching the log, it's only viewable via omv GUI.
Because of that, i've added a screenshot
It is failing to snapshot the VM (no guest tools installed?). Try taking a snapshot with virsh to get a better error message.
an other, for me new error is, that if the VNC passwords in the VM configs are longer than 8 characters, the plugin has problems (start vm etc.). This was not the case with OMV5 kvm plugin
I didn't think a password longer than 8 characters was a valid password for vnc? But anyway, I'm not sure why it isn't start since both versions started the VM exactly the same way with libvirt-php - 6.x and 5.x
Can anyone help?
You have an illegal pool name - VM's. Not sure how you created it but you shouldn't have spaces or punctuation in VM, network, or pool names.
You have an illegal pool name - VM's. Not sure how you created it but you shouldn't have spaces or punctuation in VM, network, or pool names.
Thanks! Ive created that pool before i upgrade to omv6. In omv5 all work great!
But i cant rename pool. Is it only might be deleted and recreat? or i can rename pool?
Is it only might be deleted and recreat?
I guess I will have to escape the pool name since the plugin allows some punctuation. yuck.
It is failing to snapshot the VM (no guest tools installed?). Try taking a snapshot with virsh to get a better error message.
I didn't think a password longer than 8 characters was a valid password for vnc? But anyway, I'm not sure why it isn't start since both versions started the VM exactly the same way with libvirt-php - 6.x and 5.x
was working in OMV5, (VNC password), nothing changed with the VMS...well....
regarding the failed backup, it fails even with not running VM, so only copying the file should take place. I cannot install guest tools as there are none for this OS.
Can you provide a virsh command to test the backup? i only found whole scripts while googling....
was working in OMV5, (VNC password), nothing changed with the VMS...well....
I don't maintain libvirt-php. So, if something changes, I can't control that. Does virsh start VMNAME work?
regarding the failed backup, it fails even with not running VM, so only copying the file should take place. I cannot install guest tools as there are none for this OS.
Can you provide a virsh command to test the backup? i only found whole scripts while googling....
What OS is it?
virsh isn't backing things up. The script I wrote is. And if the VM is powered off, it doesn't take a snapshot. The script enumerates the disks on the VM and backs them up using qemu-img. What do you get if you run the omv-backup-vm script against that machine?
I don't maintain libvirt-php. So, if something changes, I can't control that. Does virsh start VMNAME work?
What OS is it?
virsh isn't backing things up. The script I wrote is. And if the VM is powered off, it doesn't take a snapshot. The script enumerates the disks on the VM and backs them up using qemu-img. What do you get if you run the omv-backup-vm script against that machine?
OS is XPEnology, the "x-86" mod of a Synology Device
the backup script shows:
[2022-06-04 18:53:49+0200] [backup] Copy disks to backup directory...
[2022-06-04 18:53:49+0200] [backup] Copying disk :: syno-ds918-qcow2.img
qemu-img: Could not open 'syno-ds918-qcow2.img': Could not open 'syno-ds918-qcow2.img': No such file or directory
which is the only script output of a working VM with only shows the file instead the whole path /srv/dev- ...you name it/ i don't know why the backup of THIS VM doesn't find the path
...and regarding the VNC password... i had passwords <8 chars, but cannot enter them into virt manager anymore. So huh.... consider it solved. Something changed on an other end.....
qemu-img: Could not open 'syno-ds918-qcow2.img': Could not open 'syno-ds918-qcow2.img': No such file or directory
which is the only script output of a working VM with only shows the file instead the whole path /srv/dev- ...you name it/ i don't know why the backup of THIS VM doesn't find the path
Can you post (or PM me) the xml for this VM?
I guess I will have to escape the pool name since the plugin allows some punctuation. yuck.
When i'm trying to stop VM's pool (i create anoter pool with same path) i see an error( screns from syslog and the error)
All machines wich uses pool is stopped
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!