LibVirtKvm-scripts icon indicating copy to clipboard operation
LibVirtKvm-scripts copied to clipboard

fi_backup fails when local LANG is fr_FR.UTF-8

Open MaxiReglisse opened this issue 7 years ago • 0 comments

Very good job, Davide ! thanks.

but when LANG is set to fr_FR.UTF-8, fi_backup fails because the VM is not seen as running, as you can see here :

# LANG=fr_FR.UTF-8 && ./fi-backup.sh -c -b /var/lib/libvirt/backups/generic -d generic
[INF] libVirt version '1.3.1' support is experimental
[DEB] /usr/bin/qemu-img version '2.5.0' is supported
[DEB] QEMU/KVM version '2.5.0' is supported
[DEB] Domains NOTRUNNING to backup:  generic
[DEB] Domains RUNNING to backup: 
[ERR] Consolidation only works with running domains. 'generic' is not running! Doing full backup only of 'generic'
[ERR] Skipping consolidation/backup of 'generic'

the problem comes from the result of the virsh command. it answers "en cours d'exécution" instead of "running".

# LANG=fr_FR.UTF-8 && virsh -q domstate generic
en cours d'exécution

# LANG=en_US.UTF-8 && virsh -q domstate generic
running

Consequently, i need to prefix the fi_backup command with LANG=en_US.UTF-8

# LANG=en_US.UTF-8 && ./fi-backup.sh -c -b /var/lib/libvirt/backups/generic -d generic
[INF] libVirt version '1.3.1' support is experimental
[DEB] /usr/bin/qemu-img version '2.5.0' is supported
[DEB] QEMU/KVM version '2.5.0' is supported
[DEB] Domains NOTRUNNING to backup: 
[DEB] Domains RUNNING to backup:  generic
[DEB] Consolidation of block devices for 'generic' requested
[DEB] Block devices to be consolidated:
	/var/lib/libvirt/images/generic.bimg-20180223-155100
[DEB] Consolidation method: blockcommit
[DEB] Consolidation of '0' block device: '/var/lib/libvirt/images/generic.bimg-20180223-155100' for 'generic'
[DEB] Parent block device: '/var/lib/libvirt/images/generic.qcow2'
[VER] Consolidation of block device '/var/lib/libvirt/images/generic.bimg-20180223-155100' for 'generic' successful
[DEB] Not deleting last element of snapshot_chain (top parent) since consolidation method='blockcommit'
[VER] Deleting old backing files for 'generic'
[VER] Deleting old backing file '/var/lib/libvirt/images/generic.bimg-20180223-155100' for 'generic'

what do you think ? is it possible to fix the code perennially ? Thanks in advance.

Ernest.

MaxiReglisse avatar Feb 23 '18 14:02 MaxiReglisse