Fix extra metadata didn't assign into snapshot image

create_image action API accept metadata parameter to add extra
metadata into snapshot image. But the current code doesn't work
for snapshot of volume based instance. This error is because the
code use var 'props' to store extra metadatas, and the code use
same var to store root bdm metadata later, then the extra metadata
is overwritten by root bdm metadata. This patch use another var
'properties' to store root bdm metadata to avoid overwrite the
extra metadata.

Change-Id: I2224905f596690e22aa71dc6541284f005ebba9d
Closes-Bug: #1347355
Allow to unshelve instance booted from volume

When we shelve an instance, volumes are not detached from cinder to kept
them 'In-Use' in cinder
But when you unshelve this instance, nova ask cinder the reattach theses
volumes. This fails, because volume cannot be attached twice.

This patch permits when we ask the libvirt DriverBlockDevice to attach a
device to the instance to bypass the cinder attachement code that is not needed
when we unshelve an instance, because the cinder volume is kept 'In-use'
during the 'shelved' state.

Co-Authored-By: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>
Closes-bug: #1305399
Change-Id: I780a9407feeb48ecd3e295508ce3e6bc3b09d3e6
docs - Fix doc build errors with SQLAlchemy 0.9

The Nova docs failed to build when using SQLAlchemy 0.9. Among
the errors that are reported is this one:

nova/db/sqlalchemy/api.py:docstring of nova.db.sqlalchemy.api.select:12:
WARNING: undefined label: coretutorial_selecting (if the link has no
caption the label must precede a section header)

nova/openstack/common/db/sqlalchemy/utils.py:docstring of
nova.openstack.common.db.sqlalchemy.utils.or_:26: WARNING: more than one target found for
cross-reference u'and_': nova.db.sqlalchemy.api.and_,
nova.virt.baremetal.db.sqlalchemy.migrate_repo.versions.006_move_prov_mac_address.and_

nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/006_move_prov_mac_address.py:
docstring of nova.virt.baremetal.db.sqlalchemy.migrate_repo.versions.
006_move_prov_mac_address.and_:35: WARNING: more than one target found for cross-reference
u'or_': nova.db.sqlalchemy.api.or_, nova.openstack.common.db.sqlalchemy.utils.or_

nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/006_move_prov_mac_address.py:
docstring of nova.virt.baremetal.db.sqlalchemy.migrate_repo.versions.
006_move_prov_mac_address.select:12: WARNING: undefined label: coretutorial_selecting
(if the link has no caption the label must precede a section header)

To fix this, the imports causing breaks were removed and changed to more specific/better
imports

Change-Id: I83cf38c03cef8bb3186160a660d30979cc303839
Add missed discoverable policy rules for flavor-manage v3

Add discoverable policy rule for v3 extension flavor-manage,
Although without this patch, it also works. But that's used to
indicate to user there is option for flavor-manager discoverable.

Change-Id: I23f8bbaccfa104a12e4a4c9eea8bf04107b57d43
Add instanceset info to StartInstance response

Currently startinstance response doesn't have the
instanceset information with InstanceID, current state
and previous state. It just returns the "True".
As per the AWS API reference document, the StartInstance
response elements should include the instanceset information
as below:
<StartInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2014-02-01/">
  <requestId>req-a7326465-5ce2-4ed6-ab89-394b38cca85f</requestId>
  <instancesSet>
    <item>
      <instanceId>i-00000001</instanceId>
      <currentState>
        <code>16</code>
        <name>running</name>
      </currentState>
      <previousState>
        <code>80</code>
        <name>stopped</name>
      </previousState>
    </item>
  </instancesSet>
</StartInstancesResponse>

Included the instanceset in to startinstance response elements
and updated the test cases for startinstance response elements
in nova/tests/api/ec2/test_cloud.py file.

Change-Id: I08ef7ed88f983b66a30c76d6b7b754222097a03b
Closes-bug: #1321220
Merge "docs - Fix doc build errors with SQLAlchemy 0.9"
Merge "Allow to unshelve instance booted from volume"
Merge "Fix extra metadata didn't assign into snapshot image"
Merge "Add instanceset info to StartInstance response"
Merge "Add missed discoverable policy rules for flavor-manage v3"