NSXT instance migration: Improve logging
Add reports while image configuration is invalid, or when there are no instances to migrate Change-Id: I9def7e152bbebaf06e8d8c30d62c4f5e63b65e2e
This commit is contained in:
parent
eb1f173e42
commit
ad147ca16e
|
@ -177,6 +177,10 @@ def instance_migrate(libvirt_conn, neutron, instance, machine_type,
|
||||||
|
|
||||||
devs = root.find('devices')
|
devs = root.find('devices')
|
||||||
ifaces = devs.findall('interface')
|
ifaces = devs.findall('interface')
|
||||||
|
|
||||||
|
if not ifaces:
|
||||||
|
LOG.error('No interfaces to migrate for instance %s', instance_name)
|
||||||
|
|
||||||
for iface in ifaces:
|
for iface in ifaces:
|
||||||
iface_migrate(neutron, instance_name, iface, nsx_switch)
|
iface_migrate(neutron, instance_name, iface, nsx_switch)
|
||||||
|
|
||||||
|
@ -217,6 +221,9 @@ def main():
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
instances = conn.listAllDomains()
|
instances = conn.listAllDomains()
|
||||||
|
if not instances:
|
||||||
|
LOG.error('No instances to migrate')
|
||||||
|
|
||||||
for instance in instances:
|
for instance in instances:
|
||||||
try:
|
try:
|
||||||
instance_migrate(conn, neutron, instance, opts.get('machine-type'),
|
instance_migrate(conn, neutron, instance, opts.get('machine-type'),
|
||||||
|
|
Loading…
Reference in New Issue