working copy of openvz driver in nova trunk

Fix logging imports.

adding openvz compatible compute.filters file

Add support for SSH key injection to OpenVZ driver.

code fixes to make openvz driver compatible with nova trunk

nova no longer requires connection.py

remove migration remnants and bring the driver api in sync with ComputeDriver

the new convention is to call a driver a driver and not a connection, renaming connection.py to driver.py

adding openvz driver to the driver.py file for inclusion in known drivers

fixed logger names

renamed openvzconnection to openvzdriver

refactor openvzconnection out of driver code

factor out FLAGS for CONF

fix moved module synchronized

fixed bad synchronized syntax

bulk unit test fixes for openvz unittests

more bulk updates for unittests

more unittest fixes

additional unittest fixes

pep8 fixes

more pep8 fixes

last fixes for test_driver.py

more tests fixed

fixed all unittests and pep8 violations

adding more unittest coverage

Additional test coverage

removing missing VIFDriver

removed db access from driver.py

refactor db access from utils.py

finished factoring out db access from utils.py

fixed broken pip-requires

change the way the openvz driver is presented through nova

fix driver object returned

changed conductor instance from LocalAPI to API

refactor config to pull from oslo

fixed bad import syntax for openvz driver

added some error checking to read_instance_metadata

changed code to handle metadata as it is currently returned from the conductor service

refactor db code in tc.py

change metadata update method to fix broken syntax

moving metadata to a list of dicts

changed metadata to system_metadata

changed metadata to system_metadata with key value pairs

empty metadata seems to appear as a list yet the update type takes a dict so we force the type to be a dict if read metadata is empty

if metadata returned from conductor isn't usable form, raise a type error

use utils.metadata_to_dict to coerce the system_metadata

additional debugging log entries

more metadata fun

more metadata fun

new system_metadata implementation

finish refactor system_metadata

fixed incorrect variable name

refactor system metadata stuff

fixed bad dict iteration in format_system_metadata

change calls to instance_types to use a conductor instance to gather instance_type information from the database

changed old LoopingCall objects to new FixedIntervalLoopingCalls

fixed LoopingCall object missed in previous commit

moved admin context from function call to it's own object to be passed around inside spawn method

first pass at integrating cinder api into volumes

remove call to delete instance from db if it's not found on the host at startup.  this was a bad idea to begin with.

pep8 fixes

more pep8 fixes

fix issue where partially deleted instance is half recreated on init_host()

set instance to deleted if not found on the host

fix instance_update

clean up instance using conductor to prevent deleted instances from being revived by compute manager

removed bulk volume operations in init_host as they shouldn't be necessary anymore

remove bulk volume operations from init_host

adding new local store for volume connection information

reenable some bulk volume operations for init_host to allow reconnection of volumes

fix attach and detach to use instance ref instead of instance name

fix session_currently_connected to handle case where no iscsi sessions exist.

fix broken syntax for reading contents in ext_storage and refactor driver to remove variables named 'file'

catch case where ext_storage file is empty

check the length of contents before trying to load it through json

added a try/except block to handle empty contents

fix save method to allow us to change the ext_storage file for an instance

mount the file systems for containers that are running already so that a container reboot isn't necessary

fix incorrect key name

add utils.py to access the mount and umount commands

change the arguments passed in for mounting filesystems

fix missing split() for mount line execution

fix up uuid so that we can delete the mount points

don't raise on failure of blkid command

only remove openvz related system_metadata as nova wants to find other stuff there

add uuids to instance description to recall uuids quickly to satisfy driver contract

make plug_vifs exit early if the instance is already running

fix instantiation of openvz bulk volume operations

refactor init_host to allow the compute manager to restart the instances

fix reboot syntax

Don't fail on unmount of internal mount. If this was a delete of instance it will already be unmounted

patch up tests to reflect recent changes

fix cfg imports in tests

fix cfg imports in tests

fix get_fs_uuid tests

fix test_stop tests

fix bad openvz driver instantiation

fix removal of db access from utils.py

remove references to instance_metadata_db methods

remove references to instance_metadata_db methods

fixup instance update

fix some virtapi issues

first pass at attaching raw devices

add a _let_disk_settle method to allow the os time to resolve network attached block storage before we try to do things with it

fix the disk settling code to be in the proper place and resolve the broken code that resolves symbolic links

add rootwrap filters

fixed fdisk command and added a short sleep to give the partition table time to resolve

add retry on listing devices as they may not have settled after partitioning

fix conditonal to better identify pertinent lines

change device listing to use globbing and regular expressions

first pass at mknod

add mknod command to compute.filters

fix device name to be the passed in 'mountpoint' which is also called mount_device in the connection_info

code to clean up devices

implement the call to detach devices

remove failure when vzlist returns no instances in memory check

change conditional to check for Container(s) not found

changed conditonal to be based on the existence of stdout

fix new issues with vzlist returning exit code 1 when there are no containers on the system

fix bad privs on device create

fix code path for raw devices to not include instantiation of mount/umount file handles when not using bind mounts

change sleep time from fdisk

soften errors in utils.execute when exceptions aren't important and cleanup fs_uuid stuff in volume.py

changed iscsi.py to be a proper child of OVZVolume

more changes to better follow the object model when using OVZVolume

fixed new order for ovziscsi driver instantiation

refactor to use saved block device names in the container config

fix issue where api will allow a user to create a raw device over an existing one

fix file read where line contains quotes

fix for reboot and resume_state_on_host_boot

change reboot() to use the context passed to it from the compute manager

moved around some volume code to isolate formatted volumes

remove old references to bulk volume operations and removed all code dealing with formatted filesystems to better conform to the nova virt driver contracts

removed ovz_use_raw_devices flayg because it's not needed anymore

removed references to raise_on_error for volume operations as this was part of the kruft needed to support formatted volumes

removed extraneous aruguments from super call in iscsi volume adapter

remove pexpect from pip-requires as we no longer require it

update license info

fixed missing index in _get_vz_device_list

add method to clean out all device entries in the ctid.conf file when the last device is to be removed

worked in some code to handle removing the last ephemeral volume from a container as this is a special case for openvz

fixed special case code that handles removing the last attached device from a vz container

unittest fixes

more unittest fixes

more unittest fixes

more unittest fixes

unittest fixes and remove conductor access from _set_instance_size

more unittest fixes

coerce root_gb to an int before doing math on it as the value comes from the metadata as a string

debug logging

fixed bad formatting character

more debug logging

removed one bad debug logging

more debug logging

fixed issue where vcpus passed into _set_cpus is coerced into an int because comparissons were failing

added a forced coersion in _set_ioprio as memory_mb passed in *could* be a string

changed add/remove devices to only log warning because raising on error causes instances that are being destroyed to raise errors that aren't recoverable

removed more code related to bind mounting filesystems as that codepath isn't needed anymore

fix unittests after removal of _clean_orphaned_directories

pep8 fixes

more pep8 fixes and unittest fixes

removed empty testfile

final unittest fixes

fix broken/missing Cheetah syntax

remove _initial_secure_host because it isn't quantum friendly

remove _initial_secure_host because it isn't quantum friendly

fix tc class variable to use module scope for openstack pep8 compliance

fixed tc clss variables

make id vars global to ensure uniqueness of ids in compute manager instances

fix _wait_for_boot to only exit cleanly if the instance boots

pep8 fixes and fixed race when an instance isn't starting

Minor fixes from the feature proposal for inclusion in nova

initial merge of migration code, minus tests

pull out code that unmounted/mounted filesystems in migrations since we don't do that anymore

fixed rootwraps

cleanup the volume code in migrations

unittest fixes

uber openstack pep8/hacking fixes

add test for migrate_disk_and_power_off

adding unittest coverage for migrations

final unittests for migration code paths

change the way resize on same host is handled

fix tc_id issue on resize where an exception is raised when trying to save over an existing id

add is_migration variable to the set_instance_size call

fixed the way set_instance_size grabs instance resource allocation from nova

fulfill the get_host_ip_addr method to make migrations go

add migration transport default conf

added cp to the openvz filters for migrations

add tar to openvz.filters

fixed bad destination and added rsync command to openvz.filters

add ext_storage to actionstripts for migration and fix broken syntax for send_to_host

fix confirm migration to fix issues with the source host not getting cleaned up

remove instance update in get_info call to prevent bad state during migrations

added argument to volume handling that allows to skip certain steps during migrations because the actions are taking place when the container isn't running

fix migrate_disk_and_power_off to pass container_is_running=False when not a live migration

add more conditional code to support migrating with volumes

disconnect volumes before running the migration code

fixed finish_migration to attach volumes after the migration work has happend and the vz root is in place

fixed unittests for migration changes