novncproxy: Setup log when start nova-novncproxy

Because log system not setup, so log_dir, log_file config item not work.

Change-Id: Iabe7a4ca41dc0de8c752f013f6afeed5fd80b4ea
Closes-Bug: #1291949
Change listen address on libvirt live-migration

Previously, in order for libvirt live migration to work,
the graphics listen addresses (VNC and/or Spice) had to be
set on both machines to be 0.0.0.0 or ::.  This was because libvirt
would try to rebind to the source address on the destination
machine, but would fail due to the source machine already having
that address (this would not happen for 0.0.0.0 or ::, however).

Now, a modified copy of the instance's XML is passed to libvirt's
migrate function, such that the listen addresses are that of the
destination machine.  The addresses are stashed in the pre-migration
data by the destination pre-migration method.

Note that this functionality will only work on versions of libvirt
with the VIR_DOMAIN_XML_MIGRATABLE flag.  If the flag is not detected
(anything vanilla libvirt less than 1.0.0), the live migration code
will fall back to the old method.

Fixes: bug #1279563

Change-Id: I6c9500283027193179c11d18ad4242e165a9ad6e
Fix nova/network direct use of object modules

This replaces all uses of nova.objects.<module>.<object> with
nova.objects.<object> within nova/network and nova/tests/network.

Change-Id: I6438bcf47e06a401323ea708d5a44c69fa00e967
Partial-Blueprint: object-subclassing
Fixes rbd backend image size

The original fix for bug 1219658 introduced a factor of 1024 error
in the resulting rbd image size.

Fix bug #1219658

Change-Id: I3ec53b3617d52f75784ebb3b0dad92ca815f8876
Co-authored-by: Nikola Dipanov <ndipanov@redhat.com>
Signed-off-by: Haomai Wang <haomai@unitedstack.com>
VM diagnostics (v3 API only)

There is no formal definition for the VM diagnostics. For the
V2 API the diagnostics will be returned as they are today.

This will continue to use the driver function get_diagnostics.

This change will be implemented by a new virt driver method called
get_instance_diagnostics.

This will support backward compatibility with the existing API's.

Part of the blueprint v3-diagnostics

This patch set is for the API's. Virt driver support in additional
patches.

DocImpact

Change-Id: Id722f38fb134b322413d2b5c3459c8fc0af7bd36
Handle over quota exception from Neutron

When using the floating IP in Nova with Neutron, and
a quota limit is exceeded in Neutron, the exception from
the Neutron client results in Nova generating a 500 error.
This is unhelpful to user, and not consistent with nova-networking
Return FloatingIPExceedLimit exception when quota exceeded.

Change I8788993578ac872da9f676fe3e2fb8f98414289d at neutronclient
add OverQuotaClient exception and it is used in this patch

Change-Id: Ieb90521cf231acae8b5a9920acf6c77f2e34ef67
Closes-Bug: #1210598
Closes-Bug: #1301117
Refactors VIF configuration logic

There are too many if/else checks when we choose the right function to
conduct vif operations. We can do better by getattr on the nessesary
function obj. The vif type needs normalization to remove periods.

Change-Id: I6bb2af45d3e72bdc11470877fd2a993e9d0a4623
Catch InvalidAggregateAction when deleting an aggregate

When an aggregate with 'host' attribute not empty is deleted,
InvalidAggregateAction exception will be raised, but this exception
is not handled.

Closes-Bug: #1303591
Change-Id: I4ef0c4a6008acea7e9769e93de79451cfbc0a0fa
Standardization of nova.image.API.download

Brings the wacky download method into the new nova.image.API object and
removes calls to nova.image.glance throughout the virt drivers that were
using various call signatures of glance.ImageService.download. Since
some of the wrapper objects that fetched image bits from Glance were
using the get and update methods of the former
nova.image.glance.GlanceImageService object, those calls were updated to
instead call the new, standardized nova.image.API methods of the same
name and call signature.

The final patch in this series will refactor the remaining direct use of
the nova.image.glance module, which are calls to
glance.generate_image_url() and glance.generate_glance_url().

Change-Id: Ib3a85d0875c06c4e54e4211bc2fb8ce3fe16161d
Partially-implements blueprint: standardize-nova-image
Remove unused instance variables from HostState

The request was to fix num_instances_by_project in HostState to
correctly report state even when last VM was deleted.

However in investigation I discovered this instance variable isn't
used in openstack code.  Following policy, we should be removing this
code.  Also removed vm_states, task_states and
num_instances_by_os_type.

Change-Id: I4ba30a9c0639803d19d5e8355f5bc8dd3f543671
Closes-Bug: 1201379
Translations: add LC to all LOG.critical messages

Update all instance of this in the code.

Patch https://review.openstack.org/#/c/105675/ deals with the
other case.

TrivialFix

Change-Id: I31e2a18d94bb4d8a88d99669b31181a1dea7ad05
Merge "Fixes rbd backend image size"
Merge "VM diagnostics (v3 API only)"
Merge "Remove unused instance variables from HostState"
Merge "novncproxy: Setup log when start nova-novncproxy"
Improve shared storage checks for live migration

Due to an assumption that libvirt live migrations work only when both
instance path and disk data is shared between source and destination
hosts (e.g. libvirt instances directory is on NFS), instance disks are
removed from shared storage when instance path is not shared (e.g. Ceph
RBD backend is enabled).

Distinguish cases that require shared instance drive and shared libvirt
instance directory. Reflect the fact that RBD backed instances have
shared instance drive (and no shared libvirt instance directory) in the
relevant conditionals.

UpgradeImpact: Live migrations from or to a compute host running a
version of Nova pre-dating this commit are disabled in order to
eliminate possibility of data loss. Upgrade Nova on both the source and
the target node before attempting a live migration.

Closes-bug: 1250751
Closes-bug: 1314526
Co-authored-by: Ryan Moe <rmoe@mirantis.com>
Co-authored-by: Yaguang Tang <yaguang.tang@canonical.com>
Signed-off-by: Dmitry Borodaenko <dborodaenko@mirantis.com>
Change-Id: I2755c59b4db736151000dae351fd776d3c15ca39
Merge "Change listen address on libvirt live-migration"
Merge "Improve shared storage checks for live migration"
Merge "Handle over quota exception from Neutron"
Merge "Catch InvalidAggregateAction when deleting an aggregate"