diff --git a/instances/migrations/0004_auto_20180724_1136.py b/instances/migrations/0004_auto_20180724_1136.py
new file mode 100644
index 0000000..82480cd
--- /dev/null
+++ b/instances/migrations/0004_auto_20180724_1136.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.13 on 2018-07-24 11:36
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('instances', '0003_instance_created'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='instance',
+ name='name',
+ field=models.CharField(max_length=120),
+ ),
+ ]
diff --git a/vrtManager/storage.py b/vrtManager/storage.py
index 0a59b97..20a219f 100644
--- a/vrtManager/storage.py
+++ b/vrtManager/storage.py
@@ -169,6 +169,10 @@ class wvmStorage(wvmConnect):
vol = self.get_volume(name)
return vol.info()[1]
+ def get_volume_allocation(self, name):
+ vol = self.get_volume(name)
+ return vol.info()[2]
+
def _vol_XMLDesc(self, name):
vol = self.get_volume(name)
return vol.XMLDesc(0)
@@ -196,6 +200,7 @@ class wvmStorage(wvmConnect):
vol_list.append(
{'name': volname,
'size': self.get_volume_size(volname),
+ 'allocation': self.get_volume_allocation(volname),
'type': self.get_volume_type(volname)}
)
return vol_list
@@ -216,14 +221,20 @@ class wvmStorage(wvmConnect):
%s
+
+ 107
+ 107
+ 0644
+
+
""" % (name, size, alloc, vol_fmt)
self._createXML(xml, metadata)
- def clone_volume(self, name, clone, vol_fmt=None, metadata=False):
+ def clone_volume(self, name, target_file, vol_fmt=None, metadata=False):
storage_type = self.get_type()
if storage_type == 'dir':
- clone += '.img'
+ target_file += '.img'
vol = self.get_volume(name)
if not vol_fmt:
vol_fmt = self.get_volume_type(name)
@@ -234,6 +245,12 @@ class wvmStorage(wvmConnect):
0
+
+ 107
+ 107
+ 0644
+
+
- """ % (clone, vol_fmt)
+ """ % (target_file, vol_fmt)
self._createXMLFrom(xml, vol, metadata)