diff options
| author | Vishvananda Ishaya <vishvananda@yahoo.com> | 2010-08-29 22:41:43 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@yahoo.com> | 2010-08-29 22:41:43 -0700 |
| commit | 7639fe7cb6220f0393e6ee5ec43cd6b9ac35e5a9 (patch) | |
| tree | da0552de6034b5748d447c0a46108face817ce22 | |
| parent | fab0bbaca8d6cf34f131c4426463bf5c76a0477f (diff) | |
remove creation of volume groups on boot
| -rw-r--r-- | nova/volume/driver.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/nova/volume/driver.py b/nova/volume/driver.py index e0468b877..648ae1a06 100644 --- a/nova/volume/driver.py +++ b/nova/volume/driver.py @@ -26,12 +26,9 @@ from twisted.internet import defer from nova import flags from nova import process -from nova import utils FLAGS = flags.FLAGS -flags.DEFINE_string('storage_dev', '/dev/sdb', - 'Physical device to use for volumes') flags.DEFINE_string('volume_group', 'nova-volumes', 'Name for the VG that will contain exported volumes') flags.DEFINE_string('aoe_eth_dev', 'eth0', @@ -60,13 +57,14 @@ class FakeAOEDriver(object): class AOEDriver(object): def __init__(self, *args, **kwargs): super(AOEDriver, self).__init__(*args, **kwargs) - # NOTE(vish): no need for thise to be async, but it may be - # best to explicitly do them at some other time - utils.execute("sudo pvcreate %s" % (FLAGS.storage_dev)) - utils.execute("sudo vgcreate %s %s" % (FLAGS.volume_group, - FLAGS.storage_dev)) + + @defer.inlineCallbacks + def _ensure_vg(self): + yield process.simple_execute("vgs | grep %s" % FLAGS.volume_group) + @defer.inlineCallbacks def create_volume(self, volume_id, size): + self._ensure_vg() if int(size) == 0: sizestr = '100M' else: |
