[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new to python - like to write a script with the libvirt-python 5.3.0 package

Hello dear Python-community,

i'm pretty new to Python. I made a seminar two weeks ago and like to write now a script because if i don't i will have forgotten everything in a few weeks.
If this is the wrong place to ask my question please tell me where is the appropriate one.
I'm a Sysadmin, not a software developer. 
We are running a two-node High Availibility cluster on SLES 12 SP4 with virtual machines on it.
I wrote a shellscript to create consistent images of the virtual machines each night, using the bash and virsh (the libvirt shell).
Script is running fairly fine, but i need to extend it.
I'm thinking of rewriting it in python, i think that would be a good practise.
Inside the script i'm using things like "virsh start, virsh shutdown, virsh snaphot-list, virsh snapshot, virsh snapshot-delete, virsh domblklist, virsh blockcommit, virsh list, virsh define ..."
Can i use all the possibilities i have in virsh in that libvirt-package ?

I'm also creating logfiles, deleting files, sending e-Mails, redirecting stdout and stderr.
This shouldn't be a problem in Python ?




Bernd Lentes 
Institut f?r Entwicklungsgenetik 
Geb?ude 35.34 - Raum 208 
HelmholtzZentrum m?nchen 
bernd.lentes at 
phone: +49 89 3187 1241 
phone: +49 89 3187 3827 
fax: +49 89 3187 2294 

wer Fehler macht kann etwas lernen 
wer nichts macht kann auch nichts lernen

Helmholtz Zentrum Muenchen
Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH)
Ingolstaedter Landstr. 1
85764 Neuherberg
Stellv. Aufsichtsratsvorsitzender: MinDirig. Dr. Manfred Wolter
Geschaeftsfuehrung: Prof. Dr. med. Dr. h.c. Matthias Tschoep, Heinrich Bassler, Kerstin Guenther
Registergericht: Amtsgericht Muenchen HRB 6466
USt-IdNr: DE 129521671