Skip to content

Commit

Permalink
Fix for livemigration provision breakage.
Browse files Browse the repository at this point in the history
Closes-Bug: #1389349
Issue: Live migration provisioning is broken.
Fix: 1. Corrected the setup arguments, which were pointing to wrong name
     2. Corrected the entry point for the compute-livemigration script.
     3. Enabled calling of the compute-livemigration script from
        storage/setup.py
Test: Verified the changes in QA setup.

Change-Id: Iaeeb970714e430154c73fbfe51478bb5d5fc6242
  • Loading branch information
Jeya ganesh babu  committed Nov 5, 2014
1 parent b168cd2 commit 1afe5da
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
14 changes: 5 additions & 9 deletions contrail_provisioning/storage/livemigration_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,17 @@ def enable_nfs_live_migration(self):
storage_setup_args = storage_setup_args + " --storage-hostnames %s" %(' '.join(self._args.storage_hostnames))
storage_setup_args = storage_setup_args + " --storage-hosts %s" %(' '.join(self._args.storage_hosts))
storage_setup_args = storage_setup_args + " --storage-host-tokens %s" %(' '.join(self._args.storage_host_tokens))
live_migration_status = self._args.live_migration
setup_args_str = setup_args_str + " --live-migration %s" % (live_migration_status)
nfs_live_migration_option = self._args.nfs_live_migration
setup_args_str = setup_args_str + " --nfs-live-migration %s" % (nfs_live_migration_option)
if self._args.nfs_livem_subnet:
setup_args_str = setup_args_str + " --nfs-livem-subnet %s" % (' '.join(self._args.nfs_livem_subnet))
setup_args_str = setup_args_str + " --nfs-livem-image %s" % (' '.join(self._args.nfs_livem_image))
setup_args_str = setup_args_str + " --nfs-livem-host %s" % (' '.join(self._args.nfs_livem_host))
storage_setup_args = storage_setup_args + " --nfs-livem-subnet %s" % (' '.join(self._args.nfs_livem_subnet))
storage_setup_args = storage_setup_args + " --nfs-livem-image %s" % (' '.join(self._args.nfs_livem_image))
storage_setup_args = storage_setup_args + " --nfs-livem-host %s" % (' '.join(self._args.nfs_livem_host))
if self._args.nfs_livem_mount:
setup_args_str = setup_args_str + " --nfs-livem-mount %s" % (' '.join(self._args.nfs_livem_mount))
storage_setup_args = storage_setup_args + " --nfs-livem-mount %s" % (' '.join(self._args.nfs_livem_mount))
for storage_host, storage_host_token in zip(self._args.storage_hosts, self._args.storage_host_tokens):
if storage_host == self._args.storage_master:
storage_master_passwd = storage_host_token
with settings(host_string=self._args.storage_master, password=storage_master_passwd):
sudo("livemnfs-ceph-setup %s" %(storage_setup_args))
sudo("livemnfs-setup %s" %(storage_setup_args))


def main(args_str = None):
Expand Down
15 changes: 15 additions & 0 deletions contrail_provisioning/storage/setup.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,21 @@ def enable_storage(self):
with settings(host_string=self._args.storage_master, password=storage_master_passwd):
run("sudo storage-fs-setup %s" %(storage_setup_args))

live_migration_enabled = self._args.live_migration
if live_migration_enabled == 'enabled':
livem_setup_args = " --storage-master %s" %(self._args.storage_master)
livem_setup_args = livem_setup_args + " --storage-setup-mode %s" % (self._args.storage_setup_mode)
if self._args.add_storage_node:
livem_setup_args = livem_setup_args + " --add-storage-node %s" % (self._args.add_storage_node)
livem_setup_args = livem_setup_args + " --storage-hostnames %s" %(' '.join(self._args.storage_hostnames))
livem_setup_args = livem_setup_args + " --storage-hosts %s" %(' '.join(self._args.storage_hosts))
livem_setup_args = livem_setup_args + " --storage-host-tokens %s" %(' '.join(self._args.storage_host_tokens))
if self._args.storage_os_hosts:
livem_setup_args = livem_setup_args + " --storage-os-hosts %s" %(' '.join(self._args.storage_os_hosts))
livem_setup_args = livem_setup_args + " --storage-os-host-tokens %s" %(' '.join(self._args.storage_os_host_tokens))
with settings(host_string=self._args.storage_master, password=storage_master_passwd):
run("sudo compute-live-migration-setup %s" %(livem_setup_args))


def main(args_str = None):
storage = StorageSetup(args_str)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def requirements(filename):
# Helper scripts
'setup-quantum-in-keystone = contrail_provisioning.config.quantum_in_keystone_setup:main',
'storage-fs-setup = contrail_provisioning.storage.storagefs.setup:main',
'compute-live-migration-setup = contrail_provisioning.storage.compute.livemigration_setup:main',
'compute-live-migration-setup = contrail_provisioning.storage.compute.livemigration:main',
'livemnfs-setup = contrail_provisioning.storage.storagefs.livemnfs_setup:main',
'storage-webui-setup = contrail_provisioning.storage.webui.setup:main',
],
Expand Down

0 comments on commit 1afe5da

Please sign in to comment.