Should finish allocating network before VM reaches ACTIVE
This patch can fix issues like tempest caused by async
network allocation. Nova uses NetworkInfoAsyncWrapper
to allocate network in an async manner, and this allows
one to start querying for network info before you know
you will need it. Nova will invoke refresh_cache method
to update instance_cache_info after excuting the
allocate_for_instance method as well.
However, nova rest api will query instance_cache_info
directly, thus maybe get the empty network info before
instance_cache_info table has been updated asynchronously.
Thus will cause VM can exist without a known address
accidentally, the caller is difficult to distinguish
this situation, unless waiting for some internal process
or it will not have an address. So should finish
allocating network before the VM reaches ACTIVE status.
For more detail can refer the bug description.
BTW, almost all create server related unit tests have
coverred this case.
Reviewed: https:/ /review. openstack. org/43279 github. com/openstack/ nova/commit/ c51f23834db5995 58098e38a7b4ccd 7ef1c49a95
Committed: http://
Submitter: Jenkins
Branch: master
commit c51f23834db5995 58098e38a7b4ccd 7ef1c49a95
Author: zhhuabj <email address hidden>
Date: Thu Aug 22 20:11:08 2013 +0800
Should finish allocating network before VM reaches ACTIVE
This patch can fix issues like tempest caused by async cWrapper for_instance method as well.
network allocation. Nova uses NetworkInfoAsyn
to allocate network in an async manner, and this allows
one to start querying for network info before you know
you will need it. Nova will invoke refresh_cache method
to update instance_cache_info after excuting the
allocate_
However, nova rest api will query instance_cache_info cache_info table has been updated asynchronously.
directly, thus maybe get the empty network info before
instance_
Thus will cause VM can exist without a known address
accidentally, the caller is difficult to distinguish
this situation, unless waiting for some internal process
or it will not have an address. So should finish
allocating network before the VM reaches ACTIVE status.
For more detail can refer the bug description.
BTW, almost all create server related unit tests have
coverred this case.
Closes-Bug: #1210483 9661d717ec596d2 a37b975169a
Change-Id: Iab542df1be7d5c