(self, stg_type, name, source, target)
| 24 | self.wvm.storagePoolDefineXML(xml, flag) |
| 25 | |
| 26 | def create_storage(self, stg_type, name, source, target): |
| 27 | xml = """ |
| 28 | <pool type='%s'> |
| 29 | <name>%s</name>""" % (stg_type, name) |
| 30 | if stg_type == 'logical': |
| 31 | xml += """ |
| 32 | <source> |
| 33 | <device path='%s'/> |
| 34 | <name>%s</name> |
| 35 | <format type='lvm2'/> |
| 36 | </source>""" % (source, name) |
| 37 | if stg_type == 'logical': |
| 38 | target = '/dev/' + name |
| 39 | xml += """ |
| 40 | <target> |
| 41 | <path>%s</path> |
| 42 | </target> |
| 43 | </pool>""" % target |
| 44 | self.define_storage(xml, 0) |
| 45 | stg = self.get_storage(name) |
| 46 | if stg_type == 'logical': |
| 47 | stg.build(0) |
| 48 | stg.create(0) |
| 49 | stg.setAutostart(1) |
| 50 | |
| 51 | def create_storage_ceph(self, stg_type, name, ceph_pool, ceph_host, ceph_user, secret): |
| 52 | xml = """ |
no test coverage detected