Scenario:
1. Configure the resize_confirm_window to 60 seconds, connection_type to 'libvirt' and libvirt_type to 'kvm'.
2. Create an instance and resize it (do not confirm the resize).
3. Verify the Compute logs for '_poll_unconfirmed_resizes' periodic task.
Branch: master
Expected Behavior: Compute should automatically confirm any unconfirmed resizes that are older than "resize_confirm_window".
Actual Behavior: The automatic confirmation code fails, following is the stack trace in Compute log:
2012-04-04 05:06:38 DEBUG nova.virt.libvirt.connection [-] Updating host stats from (pid=24785) update_status /opt/stack/nova/nova/virt/libvirt/connection.py:2591
2012-04-04 05:06:41 DEBUG nova.manager [-] Running periodic task ComputeManager._poll_unconfirmed_resizes from (pid=24785) periodic_tasks /opt/stack/nova/nova/manager.py:152
2012-04-04 05:06:41 INFO nova.virt.libvirt.connection [-] Found 1 unconfirmed migrations older than 60 seconds
2012-04-04 05:06:41 INFO nova.virt.libvirt.connection [-] Automatically confirming migration 1
2012-04-04 05:06:41 ERROR nova.manager [-] Error during ComputeManager._poll_unconfirmed_resizes: 'LibvirtConnection' object has no attribute 'compute_api'
2012-04-04 05:06:41 TRACE nova.manager Traceback (most recent call last):
2012-04-04 05:06:41 TRACE nova.manager File "/opt/stack/nova/nova/manager.py", line 155, in periodic_tasks
2012-04-04 05:06:41 TRACE nova.manager task(self, context)
2012-04-04 05:06:41 TRACE nova.manager File "/opt/stack/nova/nova/compute/manager.py", line 2245, in _poll_unconfirmed_resizes
2012-04-04 05:06:41 TRACE nova.manager self.driver.poll_unconfirmed_resizes(FLAGS.resize_confirm_window)
2012-04-04 05:06:41 TRACE nova.manager File "/opt/stack/nova/nova/exception.py", line 114, in wrapped
2012-04-04 05:06:41 TRACE nova.manager return f(*args, **kw)
2012-04-04 05:06:41 TRACE nova.manager File "/opt/stack/nova/nova/virt/libvirt/connection.py", line 854, in poll_unconfirmed_resizes
2012-04-04 05:06:41 TRACE nova.manager self.compute_api.confirm_resize(ctxt, migration.instance_uuid)
2012-04-04 05:06:41 TRACE nova.manager AttributeError: 'LibvirtConnection' object has no attribute 'compute_api'
2012-04-04 05:06:41 TRACE nova.manager
Fix proposed to branch: master /review. openstack. org/6361
Review: https:/