xenapi: allow non rsa key injection

Currently if you attempt to inject a dsa key into a server, you are
unable to start the server because the saving of the password will
always fail. This ensures the saving of the password is only attempted
when injecting an rsa based key.

Fixes bug 1206458
Change-Id: I85e259c7d61182d32d2661662483237e7ad8feed
db: Remove deprecated assert_unicode attribute

Remove deprecated assert_unicode sqlalchemy attribute,
removed in sqlalchemy 0.8.0. The deprecation is described
at:

http://docs.sqlalchemy.org/en/latest/changelog/changelog_08.html#change-ad44af79c886d1bb283042deb64f9cbe

Fixes LP: #1208382

Change-Id: I56ad98d3702f53fe8cfa94093fea89074f7a5e90
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Merge "xenapi: allow non rsa key injection"
Merge "db: Remove deprecated assert_unicode attribute"
Inherit base image properties on instance creation

When starting an instance, a few properties from the image will be saved
in the instance's system_metadata under the prefix 'image_'. This way,
when creating an snapshot, resizing, migrating or rescuing an instance
we can preserve the original properties even if the source image has
been deleted or made private.

This is done by adding two utility functions that translate the image
metadata into system metadata and vice versa. These are  used from the
operations specified before to complement the image metadata and
preventing them to fail if the image doesn't exist.

The keys that the instance will inherit from the image are: 'min_ram',
'min_disk', 'disk_format' and 'container_format' together with the
inheritable image properties.

Fixes bug #1039662

Change-Id: If6a7b182a2fb46cdd05bd19760fcd246442b7f4b