Merge "Fix state logic for auto-confirm resizes"
Make compute only auto-confirm its own instances

Fixes bug 1030226

Change-Id: I0e0cf0c9950f34b1bdab856b2e1c6872b29fdedc
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
Support external gateways in VLAN mode.

Add network label when starting dnsmasq. Fixes bug 1012443.

To allow for per-network dnsmasq customization we can use the network
label from the database as the dnsmasq network tag. A user can then
specify a custom dnsmasq config file using the 'dnsmasq_config_file'
configuration flag.

An example dnsmasq config file showing how to set a custom external
gateway or ntp server for particular networks based on their tag/label
follows:

dhcp-option=tag:'private',option:router,10.0.0.254
dhcp-option=tag:'private',option:ntp-server,10.0.0.253
dhcp-option=tag:'private',option:dns-server,8.8.8.8

dhcp-option=tag:'blue',option:router,10.10.0.254
dhcp-option=tag:'blue',option:ntp-server,10.10.0.253
dhcp-option=tag:'blue',option:dns-server,8.8.4.4

Change-Id: I56cb175a968e33b803dfcb965f90f3a5ca4983ca
maint: libvirt imagecache: remove redundant interpreter spec

This causes "non-executable-script" warnings in rpmlint at least.

Change-Id: Ia62ce7026cfa59cfc7ab457fbb246496c8f58c10
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
Check for selinux before setting up selinux.

Check to see if /etc/selinux exists before trying
to setup ssh keys for selinux. If it doesnt exist
it will result in a traceback when setting up the image
since the directory doesnt exist on Ubuntu.

Fixes LP: #1030609

Change-Id: I8af1e6232bc5a84cbb878c2663ab30eb4139484c
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "Support external gateways in VLAN mode."
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
Merge "maint: libvirt imagecache: remove redundant interpreter spec"
Merge "EC2 DescribeImageAttribute by kernel/ramdisk."
Add a link from HACKING to wiki GitCommitMessages page

The HACKING file contains a short example of an effective
commit message. For reasons for space, it cannot describe
the rationale behind this example. It also does not have
space to describe how to split up a patch into a series
of commits. Add a link from the HACKING file to the wiki

   http://wiki.openstack.org/GitCommitMessages

where further information can be found

Change-Id: I34d44485486b623b11743106f09d5ef631d35888
Avoid error during snapshot of ISO booted instance

Fixes bug #1023492

If you boot an instance from an image with disk_format=iso and then
attempt to snapshot (i.e. nova image-create) you currently get a
traceback because we do:

  qemu-img convert -f qcow2 -O iso -s $snap $disk $out

and 'iso' is not a format that qemu-img knows anything about.

When booting the image, we use qemu-img to detect that the file is
a raw image so we avoid having to special case disk_format=iso
there. However, there's no way of avoiding the special casing when
extracting a snapshot.

Note 1 - it's not very clever to take a snapshot of a read-only
disk downloaded from glance and upload it back to glance again.
Adding such smarts would be a nice enhancement.

Note 2 - only the destination format is important here because
we can only be extracting from a qcow2 image since snapshots
only work where use_cow_images=True. See also #1030844.

Change-Id: I21ff6db8ebb59a83d27f224283fb76f582c38a0e
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
Merge "Make compute only auto-confirm its own instances"
Use common parse_isotime in GlanceImageService

Rather than reimplement openstack-common's isotime functionality,
just use what's provided for us!

Change-Id: Id44eab3c34ae2c682d27d1563c6baaf68b979d2b
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>
Resize.end now includes the correct instance_type

Fixes bug 1031004. Moves the notification to the destination compute node
so that the correct instance_type attributes are assigned.

Change-Id: I5886154ddd7a9768dc5d82dc4e43e9e0f681ee04