/[adm]/puppet/modules/libvirtd/files/storage_add.py
ViewVC logotype

Contents of /puppet/modules/libvirtd/files/storage_add.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1426 - (show annotations) (download) (as text)
Tue Mar 29 23:09:40 2011 UTC (13 years, 1 month ago) by misc
File MIME type: text/x-python
File size: 495 byte(s)
CreateXml do not create persistant pool, while Define does

1 #!/usr/bin/python
2 import libvirt
3 import sys
4
5 name = sys.argv[1]
6 path = sys.argv[2]
7
8 storage_xml = """
9 <pool type='dir'>
10 <name>%s</name>
11 <capacity>0</capacity>
12 <allocation>0</allocation>
13 <available>0</available>
14 <source>
15 </source>
16 <target>
17 <path>%s</path>
18 <permissions>
19 <mode>0700</mode>
20 <owner>-1</owner>
21 <group>-1</group>
22 </permissions>
23 </target>
24 </pool>""" % ( name, path )
25
26 c=libvirt.open("qemu:///system")
27 c.storagePoolDefineXML(storage_xml,0)
28

  ViewVC Help
Powered by ViewVC 1.1.30