Skip to content

Commit

Permalink
Added configuration of the storage pool for LXD plugin, solving #148 (#…
Browse files Browse the repository at this point in the history
…149)

Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
  • Loading branch information
gabrik committed Sep 5, 2019
1 parent c30dc4c commit f1f66b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fos-plugins/LXD/LXD_plugin
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class LXD(RuntimePluginFDU):
file_dir = os.path.dirname(__file__)
self.DIR = os.path.abspath(file_dir)
self.update_interval = manifest.get('configuration').get('update_interval', 10)
self.lxd_storage_pool = manifest.get('configuration').get('storage_pool', 'default')

self.conn = None
self.images = {}
self.flavors = {}
Expand Down Expand Up @@ -1032,11 +1034,11 @@ class LXD(RuntimePluginFDU):
lxd_version = self.conn.host_info['environment']['server_version']
if version.parse(lxd_version) >= version.parse('2.20'):
st_n = 'root'
st_v = json.loads(str(template_disk % ('/', 'default', int(fdu.get_computation_requirements().get('storage_size_gb')))))
st_v = json.loads(str(template_disk % ('/', self.lxd_storage_pool, int(fdu.get_computation_requirements().get('storage_size_gb')))))
devices.update({st_n: st_v})
# if fdu.storage is None or len(fdu.storage) == 0:
# st_n = 'root'
# st_v = json.loads(str(template_disk % ('/', 'default')))
# st_v = json.loads(str(template_disk % ('/', self.lxd_storage_pool,)))
# devices.update({st_n: st_v})
# else:
# for s in fdu.storage:
Expand Down
1 change: 1 addition & 0 deletions fos-plugins/LXD/LXD_plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
],
"description": "lxd fdu plugin",
"configuration": {
"storage_pool":"default",
"ylocator": "tcp/127.0.0.1:7887",
"nodeid": "e0e442af51d14802a9bc71b5e634440e",
"update_interval": 5
Expand Down

0 comments on commit f1f66b1

Please sign in to comment.