Commit Graph

45 Commits

Author SHA1 Message Date
Monty Taylor bed4b3ff68 Retire stackforge/openvz-nova-driver 2015-10-17 16:04:08 -04:00
Kevin Conway f1cf199214 Add cleanup of ovz dirs and concurrency workaround
Some of the openvz directories were not getting cleaned up after
and instance was deleted. Now those directories are deleted if they
still exist.

We also noticed an issue where, under load, the driver would run
multiple get_next_id calls before creating the next container. This
made it possible for two containers to share the same CTID which
causes the spawn to fail. This solution uses a directory on the
file system to indicate that a CTID is chosen but not spawned and
also a semaphore in the form of the oslo lockutils.

Change-Id: Ibac11d5dc8b9eaaf9d14dacacc85e600ee342c9a
2014-07-23 14:33:54 -05:00
Kevin Conway a46c359dbc The get_next_id must be string to avoid breaking existing code
The cast as string was left out of the recent patch. Adding it again.

Change-Id: I13ca9432b9ae892886e07ad669274ff4186dfba4
2014-07-09 13:09:20 -05:00
Kevin Conway 5ae88dce0d Fix container.get_next_id bug
Change-Id: Ia7238667b05fd6f969fc087af0f82dea38a3932d
2014-07-08 15:28:46 -05:00
Jenkins f3b65344a5 Merge "Next vz id will consider vz directories as well" 2014-07-08 16:42:20 +00:00
Joe Cruz f48a08a40b Delete host device during deataching of volume
The host device (/dev/*) should be removed after the device is removed
from within the container, else a kernel I/O error will occur.

Change-Id: I43ae839d6a9c8643a43b0c063f39715c53552c77
2014-07-03 17:22:56 -05:00
Joe Cruz 899ba232c2 Next vz id will consider vz directories as well
The next vz id to use to create a new container should also consider
the vz id directories that exist in addition to containers that are
running. There can be container that was deleted but for some reason
did not clean up all its directories within /var/lib/vz/{private,root}
which will cause the next container that reuses that id to fail.

Change-Id: I5813c30f594d99a6a21054cd5b3caa24d85039fe
2014-07-03 11:09:21 -05:00
Jenkins 3e49370474 Merge "Add retry to symlink resolution for iscsi volumes" 2014-05-22 01:03:44 +00:00
Kevin Conway be6ae5f8a0 Add option to set OVZ layout
The new ovz tools changed the default layout for ovz create. This
allows us to specifiy which one we want to use.

Change-Id: I880058d19510e080e19d07f3f6e5e1ab2632832e
2014-05-21 14:11:37 -05:00
Kevin Conway f416325ed1 Add retry to symlink resolution for iscsi volumes
The ISCSI driver returns a device name that maps to
/dev/disk/by-path/ip-%s-iscsi-%s-lun-%s. This points shows up as a
symlink that points to the actual device in /dev that matches the
pattern of /dev/sd*.

Occasionally, this symlink does not resolve on the first pass which
causes the /dev/disk/by-path/ip-%s-iscsi-%s-lun-%s path to be returned
instead of the actual /dev/ path. This causes the _list_host_devices
from the base volume driver to return no volumes.

This patch forces the ISCSI volume driver to retry the symlink resolution
until it gets the /dev/ path it needs.

Change-Id: Ia6f255b4243de6dff689cdb446fd168075f96cdb
2014-05-21 13:50:55 -05:00
Paul Marshall 99dc056495 run migration rsync as root; also removes no hostkey check
Change-Id: Ib8ec090a5f3a2cd4f5cdd56741c639c34f0bb913
2014-05-08 16:09:47 -05:00
Paul Marshall 947773cccf disable strict hostkey checking for rsync
Change-Id: I45e9dd9e388ca32ad96600983b70eefb1394a9d8
2014-05-07 14:54:30 -05:00
Joe Cruz e62a053881 Container flavor settings and Vswap
* This allows for defining exact vz configs for specific flavor, instead
  of the driver calculating them.  We can define future flavor-specific
  vz configs through nova flavor extra_specs (metadata) instead of adding
  configs in the driver.

  Current vz configs that can be defined through flavor extra specs:
  - 'vz_config_file': vz config file to initially apply
  - 'vz_cpulimit': vz cpulimit
  - 'vz_bandwidth': tc bandwidth limit

* Vswap has been added as the new default way of setting memory settings

* Refactoring has been done to use new Container class.  Also new
  resource_manager class has been created to centralize most vz calculations
  and config logic (vz networking has been left alone).

* Got rid of reset_instance_size since its not used by nova-compute manager.

* Changed vz config that is initially applied to be a fresh new container
  config and flavor extra_specs driven.

Change-Id: I125682bbe89cedec08f328394ebb402a5c079b6d
2014-04-28 17:37:24 -05:00
Joe Cruz fbcaf28eee Add VZ ctid to instance_system_metadata
Use instance system_metadata table to store the instance's container
id so it can be retrieved by nova api extensions.

Change-Id: I61ee802942df0c9252d7e28c096a7b1ac41b8fba
2014-04-22 10:46:46 -05:00
Kevin Conway 2c64ea7e94 Create the lib/vz/root/<ctid> directory if not exists
OpenVZ requires an empty folder in /lib/vz/root/<ctid> in order to
start a container. This folder is no longer being created by the
migration logic. This check creates it if it doesn't exist.

Change-Id: I21a5141d3b0b412922c1f112b7f505380c856efe
2014-04-07 16:31:33 -05:00
Jenkins 47afaf592e Merge "Adds flag for enabling the creation of a disk partition" 2014-03-07 17:26:40 +00:00
Paul Marshall 64914dacff Adds flag for enabling the creation of a disk partition
Change-Id: Id667208d1516031c770de830580afdf0176791de
2014-03-06 11:12:53 -06:00
Paul Marshall f3c3ba2c98 adds driver calls to get blockdev size and rescan iscsi
Change-Id: Ife65862f2cbb55c9091c6b4e4229f8b5d7fdbba8
2014-03-06 07:43:11 -06:00
Jenkins 0b10385183 Merge "Don't fail provision if there's a duplicate tc_id" 2014-03-03 17:09:03 +00:00
Tim Simpson 86ee4cc7a9 Don't fail provision if there's a duplicate tc_id
The old driver would accept multiple tc_ids.

Change-Id: I80277ae57a02a2b10744e4f7b1723893b4c62fa6
2014-03-03 11:00:40 -06:00
Greg Hill d35f5d4f60 disassociate the nova id from the ovz id
The driver no longer relies on the deprecated nova 'id' column
in order to configure openvz. Some additional changes were made
to associate containers with the nova host that spawned them
to allow this driver to run multiple on nova-compute instances on
a single host.

A side benefit is now we have an object representing an openvz
container that can be extended to provide better OO facilities
than were previously available.

Change-Id: Ie86f4133f9a2e0afdaff805870855b12abd87a18
2014-02-18 10:29:47 -06:00
Jenkins cd15d3272f Merge "Check that uuid is in the description, otherwise skip." 2014-02-12 19:03:30 +00:00
Paul Marshall 466db7cf83 Check that uuid is in the description, otherwise skip.
In this case we've found that different versions of OpenVZ may
include output for this vzlist command (e.g., just a -) if there
aren't any instances. We just want to ignore these if the json
isn't there as expected (since _set_description is what should
construct them in the first place).

Change-Id: I472bbb63afe1313e74b742297320bf0adebacc32
2014-02-12 12:02:16 -06:00
Jenkins c26f4b2a38 Merge "allow error code 21 when checking iscsi session before login" 2014-02-12 17:58:42 +00:00
Greg Hill 79ec3afa8c update to match latest nova method signatures
Nova made backwards-incompatible changes in how it
calls these methods in the driver.  Altered the
method signatures to match the new expectation.

Change-Id: I02182dae9159bcac671899df846e50b301f16003
2014-02-11 11:25:34 -06:00
Daniel Salinas a1b6d08d18 Add check to driver.destroy() to see if there currently is an in-flight resize on the same host so we don't completely destroy the users data.
Change-Id: Id4824e102c5ea7741cec0e5c46b867972e3a032d
2014-01-27 14:08:19 -06:00
Paul Marshall 0a8266d782 allow error code 21 when checking iscsi session before login
On a node with no iscsi established sessions running (e.g. a new
node) 'iscsiadm -m session' may return error code 21 signifying
that there aren't any sessions, etc. to execute on. In this case
it's perfectly valid and the login should still proceed.

Change-Id: I1cee2a1aa55e44b9a66b8a1809d75c4cbd703777
2013-12-17 10:54:17 -06:00
Paul Marshall 42360fe65d updates for resize to work with latest nova
Change-Id: I6e0bfe99338eae73fee5a3b98c54cb398c62a5de
2013-12-05 13:37:21 -06:00
Paul Marshall d7911847b1 Prepend dev to volume mount device if it isn't there
Change-Id: I8fd30344204a2e7042b960252313ab21af3266b5
2013-11-22 08:43:58 -06:00
Daniel Salinas fff1d51173 change destroy signature to match novas contract
Change-Id: I2e95185678ceba39e483ea4e3f98fd3aed92d1cb
2013-11-16 15:17:25 -06:00
Paul Marshall 700e4216d1 Use jinja template (via nova) instead of cheetah for network interface file
Change-Id: Ib2855b3d4dd5e2ff98b9cf6f5d1d7c96ceb6fb00
2013-10-29 15:39:57 -05:00
Paul Marshall 0b3c82ebd7 Fixed the debug statement to print the file name for file injection
Change-Id: Ibbe4940043aff7ac84a6292d3e6cdc509212c917
2013-10-28 13:26:05 -05:00
Paul Marshall bd7b336187 Updates to work with latest Nova.
Specifically, updates network_info since legacy is no longer supported, as
well as other minor updates.

Change-Id: Idf1d848594826b051d6444475faed6f9812c8ba7
2013-10-07 12:53:07 -05:00
Tim Simpson fabe341771 Now the package can be installed alongside Nova.
Since this is apparently not getting into Nova it needs to be renamed
so the package name won't conflict.

Change-Id: Ib449e99c2a7756e46e4626a84ddb246265476bd3
2013-10-07 10:19:31 -05:00
Paul Marshall c13cac5e31 adds context to the destroy method
Change-Id: I7a1c7fbf7cdfc4fe400bafe2ef89c4c4588cdceb
2013-10-03 13:40:00 -05:00
Daniel Salinas a48aa25441 add numtcpsock to the things used to size an instance
Change-Id: I04d688e2165c82cd29c4249407eeaf81f71df70d
2013-07-08 16:29:48 -05:00
Daniel Salinas b123580ca3 merged in migration code
Change-Id: Id526ba721ba3c531f75768f2d5552189d7e1e3c5
2013-05-28 15:33:20 -05:00
Daniel Salinas 024e9c0604 fix packaging files to build arch independent packages for ubuntu 12.04
Change-Id: I226ae9e2090d91baba5e6bd89c7c301d2d146e4e
2013-05-10 10:55:21 -05:00
Daniel Salinas ef19f7d2c4 Add .gitreview file.
Change-Id: I44894a0570079a22ba885351d5834b7de067d514
2013-05-02 14:16:07 -05:00
Daniel Salinas b5829bc4e4 fixed files for making debian packages 2013-04-30 17:38:39 -05:00
Daniel Salinas 3be8a6f065 adding debian/rules for package building 2013-04-29 16:02:54 -05:00
Daniel Salinas c0a6f7e1cf add debian packaging files 2013-04-29 15:56:23 -05:00
Daniel Salinas 38e64f70e1 factored out all non-openvz related rootwraps 2013-04-22 14:19:32 -05:00
Daniel Salinas 9e67e5a0fc initial commit of openvz driver broken out from nova code base 2013-04-22 13:25:36 -05:00
Daniel Salinas 7480cf1365 Initial commit 2013-04-22 11:04:33 -07:00