Fix ip6tables support in xenapi bug 934603

Change-Id: Id7c4b0c4f8710652249b5c4fcb82abd5cccde6dd
Turn on base image cleanup by default.

Essex shipped with the libvirt image cache manager hobbled so it
wouldn't delete unused base images. Its been a while and we haven't
had a new bug reported in ages. Let's turn it on for Folsom. This
is tracked by bug 1029674.

Change-Id: I5529232bf4a316f844d383d5f5a3c0c287d59c1f
Prefer instance in reboot_instance.

Now that we're passed through an instance, or something which is
immediately turned into an instance, we should prefer using the full
instance inside compute methods. This is especially useful for log
messages, as it allows users to format the messages more than they
can if only the UUID is passed.

Change-Id: I29370f33a63817f3e45d453499bd46131b947d7e
Instance cleanups from detach_volumes.

We can just use members of the instance dictionary without turning
them into local variables, as we don't need to populate instance_uuid
manually, as that is done by the @checks_instance_lock decorator.

Change-Id: I2046d5688c2f5122624dc338680b7ddd850ed330
reduce debugging from utils.trycmd()

In the case where the command fails, we're returning
the err anyway and the caller can log if required.

In the discard_warnings=True case, then the caller
has explicitly asked to suppress the warnings,
so don't log this noise either.

Fixes bug: 1030609
Change-Id: I075c21aa6508182ae6dd030cf41ec31916559957
Revert "Check for selinux before setting up selinux."

The existing code used trycmd(readlink) precisely because
/etc/selinux might not exist. The presented traceback in
the bug is only debug info.

Also the change will not work with libguestfs for example,
where the nova user can't access mount points mounted by root.

After discussion on IRC it was decided to reduce
debugging output in a subsequent commit.

Reverts: 9bea239f
Change-Id: Id07eae5b330332f36ad7caa786593e486aa36469
Xen: VHD sequence validation should handle swap.

The VHD sequence validation code was erroneously counting `swap.vhd`,
which caused it to raise an exception when a corresponding numbered VHD
was not found.

The fix is to simply ignore the `swap.vhd` file.

Other unknown VHDs will generate an exception, but from a
sanity-checking perspective, this is a Good Thing(tm).

Fixes bug 1030939

Change-Id: Ic82ae27a4af7ea8f7669fd006aea1a310b691218
Fix rootwrapper with tgt-admin

Dont use the full path when calling tgt-admin.

LP: #1030850

Change-Id: Ifc7a1960aa67325e9219309e06de292010d7ec46
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Set default keystone auth_token signing_dir loc.

Updates the nova api-paste.ini file with a custom signing_dir
for Nova. This works around potential multi-service permission issues which
can occur when multiple OpenStack services share a common signing directory.

Change-Id: I99df63838fd41a4cade99b54da9511978b0d1a86
sync openstack-common log changes with nova

don't throw exceptions if %(color)s tag is used

fixes bug #1030078

If the log format strings include the %(color)s key in them and you
enable file logging, your log files won't work, and instead you'll
see exceptions on the console as the default python log handler doesn't
support that keyword.

This approach stubs out the extra keywords to be empty strings to avoid
the KeyError. Tests are also added to demonstrate the KeyError as defined
behavior, and test that color codes can be passed.

Change-Id: I24b2f45dd5a38b27b8cc5a70e0084d367e218172
Compute: VM-Mode should use instance dict.

Instance dicts no longer support attribute-style access.

Change-Id: Ia5191aa14ad7cc62630bd6b0df8aaccb87e51e03
Convert virtual_interfaces to using instance_uuid.

This review converts virtual_interfaces from tracking their
instances with instance_id to using instance_uuid.

This should be the last review for blueprint finish-uuid-conversion.

Change-Id: I303bba009fa37c72394369c8338e6e759f794cd0
Send a full instance in reset_network.

Change the reset_network method of the compute
rpc API to take a full instance over rpc instead of just
the instance UUID.  This cuts down on database access needed
by nova-compute.

Part of blueprint no-db-messaging.

Change-Id: Iaae16e63da9d48d86e3bfc80f6c0cdb9f9bd3ddd
Send a full instance in resize_instance.

Change the resize_instance method of the compute
rpc API to take a full instance over rpc instead of just
the instance UUID.  This cuts down on database access needed
by nova-compute.

Part of blueprint no-db-messaging.

Change-Id: I5ed8707b2d018559ab4e983f8528dac8377783c7
Send a full instance in resume_instance.

Change the resume_instance method of the compute
rpc API to take a full instance over rpc instead of just
the instance UUID.  This cuts down on database access needed
by nova-compute.

Part of blueprint no-db-messaging.

Change-Id: I57789eab047de7ff9b84e2bb5367139a9a7b8e40
Send a full instance in rollback_live_migration_at_destination.

Change the rollback_live_migration_at_destination method of the compute
rpc API to take a full instance over rpc instead of just
the instance ID.  This cuts down on database access needed
by nova-compute.

This was the last method of this API that was taking an instance ID
as an argument.  There still some left that take the instance UUID,
but I can see the light at the end of the tunnel.

Part of blueprint no-db-messaging.

Change-Id: Id581d23d36fee5c6fc06d2a655e999fb9aae5ae3
Send a full instance in remove_volume_connection.

Change the remove_volume_connection method of the compute
rpc API to take a full instance over rpc instead of just
the instance ID.  This cuts down on database access needed
by nova-compute.

Part of blueprint no-db-messaging.

Change-Id: I1bd47b161acd7b6dfb03adb77d00a861f754e188
Send a full instance in rescue_instance.

Change the rescue_instance method of the compute
rpc API to take a full instance over rpc instead of just
the instance UUID.  This cuts down on database access needed
by nova-compute.

Part of blueprint no-db-messaging.

Change-Id: I559bd45a8dda4537f6f4a3b8d744095291c7f058
Send a full instance in revert_resize.

Change the revert_resize method of the compute
rpc API to take a full instance over rpc instead of just
the instance UUID.  This cuts down on database access needed
by nova-compute.

Part of blueprint no-db-messaging.

Change-Id: I55bdc63149c0385fbf151f4f86f40e6c7635cf63
Send a full instance in set_admin_password.

Change the set_admin_password method of the compute
rpc API to take a full instance over rpc instead of just
the instance UUID.  This cuts down on database access needed
by nova-compute.

Part of blueprint no-db-messaging.

Change-Id: Iddcc7cb068090faa98f0bb87307e09d5b0ebf0c2