Skip to content

Commit

Permalink
Livemigraiton provision fix
Browse files Browse the repository at this point in the history
Closes-Bug: #1609543
Issue in the recent libvirt configuration. The listen
argument should be provided as env variable in init
script.

Change-Id: Icb5857db93956c26b5e7ad092e029ad2c788727c
  • Loading branch information
Jeya ganesh babu J committed Aug 3, 2016
1 parent ab25225 commit 6315c62
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contrail_provisioning/storage/compute/livemigration.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def __init__(self, args_str = None):
LIBVIRTD_TMP_CONF='/tmp/libvirtd.conf'
LIBVIRTD_CENTOS_BIN_CONF='/etc/sysconfig/libvirtd'
LIBVIRTD_UBUNTU_BIN_CONF='/etc/default/libvirt-bin'
LIBVIRTD_UBUNTU_INIT_CONF='/etc/init/libvirt-bin.conf'
LIBVIRTD_TMP_BIN_CONF='/tmp/libvirtd.tmp'
LIBVIRTD_TMP_INIT_CONF='/tmp/libvirt-bin.conf'

for hostname, entry, entry_token in zip(self._args.storage_hostnames, self._args.storage_hosts, self._args.storage_host_tokens):
with settings(host_string = 'root@%s' %(entry), password = entry_token):
Expand All @@ -54,6 +56,15 @@ def __init__(self, args_str = None):
run('service nova-compute restart')
run('service libvirt-bin restart')

libvirtd = run('ls %s 2>/dev/null |wc -l' %(LIBVIRTD_UBUNTU_INIT_CONF))
if libvirtd != '0':
libvirt_configured = run('cat %s |grep "\-d \-l"| wc -l' %(LIBVIRTD_UBUNTU_INIT_CONF))
if libvirt_configured == '0':
run('cat %s | sed s/"-d"/"-d -l"/ > %s' %(LIBVIRTD_UBUNTU_INIT_CONF, LIBVIRTD_TMP_INIT_CONF), shell='/bin/bash')
run('cp -f %s %s' %(LIBVIRTD_TMP_INIT_CONF, LIBVIRTD_UBUNTU_INIT_CONF))
run('service nova-compute restart')
run('service libvirt-bin restart')

# Fix nova uid
if self._args.fix_nova_uid == 'enabled':
uid_fix_nodes = []
Expand Down

0 comments on commit 6315c62

Please sign in to comment.