Commit Graph

301 Commits

Author SHA1 Message Date
Johannes Erdfelt a44fbea083 Ignore failure to delete kernel/ramdisk in xenapi driver
Fixes bug 1022681

If deleting the kernel/ramdisk fails because the files don't exist
anymore, then ignore the error and continue. This will ensure that the
instance will get destroyed properly even if the files were deleted
outside of nova.

Change-Id: I5d1f95ea2a6f552c48efbb9e92bb36767df19e34
2012-07-09 18:18:30 +00:00
Jenkins efa69b44cc Merge "Get hypervisor uptime." 2012-07-05 22:20:58 +00:00
Jenkins 1a7d6a0740 Merge "Run hacking tests as part of the gate." 2012-07-03 15:32:15 +00:00
Monty Taylor 8d8d3b4296 Run hacking tests as part of the gate.
Nova has additional pep8 "plugins" that they expect to run as part of the
gate. This patch will run tools/hacking.py instead of pep8 directly. Also,
it fixes the hacking violaions in contrib, plugins and smoketests.

Fixes bug 1010136

Change-Id: I86d8789218c197d5d4a43d1201465d340646a395
2012-07-02 08:50:41 -04:00
Kevin L. Mitchell 6222385d83 Get hypervisor uptime.
Adds a call to retrieve the current uptime on a specific hypervisor.
This version of the patch only adds the XenAPI variant; other virt
drivers will raise a NotImplementedError until they implement the
get_host_uptime() method.

Change-Id: Ie259589757a460fcd91a49a8dd8099e4d91524e7
2012-06-29 17:17:51 -05:00
Rick Harris 1dea34fa1a Refactoring code to kernel Dom0 plugin.
The kernel and ramdisk VDI manipulation code really has nothing to do
with Glance so it doesn't make a lot of sense for it to exist in the
Glance Dom0 plugin.

This patch refactors the code out to its own plugin and then applies a
few misc cleanups.

Change-Id: I363d54ea3c2d51aa6a6c1635b4fb59ebb9ce1fc0
2012-06-29 21:36:54 +00:00
Rick Harris 27f23001d7 Dom0 plugin now returns data in proper format.
The virt-layer code was refactored so that a dict was used to pass
around which VDIs are present. This code makes the Dom0 plugin return
that same data structure so we don't have to perform an extra conversion
step.

Change-Id: Ib4f1b0082138d233eb0c3873bbc553395510bc8d
2012-06-29 00:21:01 +00:00
Rick Harris d01e0bc661 Add missing utils declaration to RPM spec.
`utils.py` was added by the Dom0 plugin refactoring but the
corresponding declaration in the SPEC file was forgotten.

Change-Id: If12d7389a51928b1f741063e12b3b5a9015d0656
2012-06-28 22:38:53 +00:00
Rick Harris 169e601c8c Refactor Dom0 Glance plugin.
Moves shareable code out to a new utils file where future Dom0 plugins
can make use of it.

Change-Id: I57eb20b4ca308fdda424599d36d94f120d99ec0d
2012-06-28 17:07:31 +00:00
Zhongyue Luo 61c5597a09 Backslash continuation removal (Nova folsom-2)
Fixes bug #938588

Backslash continuations removal for scripts in bin/, plugin/, and etc.

Change-Id: Idd17048b6e8db6e939946968e011e68da8585b8d
2012-05-31 11:26:37 +08:00
Antony Messerli bbdbd1b87b Bump XenServer plugin version
Change-Id: I7a9389a8b07b78dec083f2a39c0ca6d9f3705ad3
2012-05-16 12:06:24 -05:00
Chris Behrens 584917cce5 Fix XenServer windows agent issue
Windows agent requires an argument of either 'agent' or 'xentools' to
the 'version' command.  All we care about is 'agent', so add it.  The
unix agent happily ignores the arg.

Fixes bug 997805

Change-Id: Ic369c8a2850173057da9d3175a02b5864d7a6514
2012-05-10 21:17:16 +00:00
Paul McMillan 1513cc178e Improve grammar throughout nova.
Fixes some "its" and "it's" mistakes, and unifies the tense of
some documentation.

Change-Id: I9b83aba535b554e80b2cf1e048bb3a4e5cac0e5e
2012-04-10 11:15:07 -07:00
Johannes Erdfelt 93874bacf7 Use 'root' instead of 'os' in XenAPI driver
Instance types define disk names as root, swap and ephemeral. The
XenAPI driver however uses os, swap and ephemeral. Standardize on
calling them 'root' disks instead of 'os' disks.

Change-Id: Ia34346d463d06cb971537c305602926ceb0dc175
2012-04-09 18:20:21 +00:00
Jenkins edca430b52 Merge "Fixes bug 954833 By adding the execute bit to the xenhost xenapi plugin" 2012-03-14 18:47:07 +00:00
Dan Prince a236fdd380 Update transfer_vhd to handle unicode correctly.
Python 2.4's shlex implementation doesn't seem to like unicode.
This updates the XenServer migration plugin so it converts to
ascii before shlex'ing the rsync args.

Fixes OSAPI resizes when using XenServer.

Fixes LP Bug #955064.

Change-Id: I7f2681bfe64ccde449a87c68b9739866a381a213
2012-03-14 10:53:36 -04:00
John Garbutt 722c54a069 Fixes bug 954833
By adding the execute bit to the xenhost xenapi plugin

Change-Id: Id1e12b84ef5c9a286d86a32b3ea1c7f3c83be47c
2012-03-14 09:36:11 +00:00
Alex Meade 00592cfa0b Use cPickle and not just pickle.
Fixes bug 953423

cPickle is up to 1000 times faster than pickle. We should use it instead.

Change-Id: I1facbdcf60d88c9fba56687abf75524498d2502e
2012-03-12 21:50:15 +00:00
Mark Washenberger e6b70b5c37 Increase logging for xenapi plugin glance uploads
Without this change, the glance plugin is pretty quiet about image
uploads. But it can definitely be helpful to debugging to have
information such as which glance server is handling the upload, how much
data was sent, and more information about the glance server response if
it was something other than 200 OK.

Change-Id: I0269478ad1061fc2021ef4b5d9c3c1dea9b2f6cb
2012-03-08 14:02:49 -05:00
Rick Harris 1da6a00a3b Validate VDI chain before moving into SR.
Fixes bug 949477

Change-Id: Ia3f283d82f189e680c5c8dd4fcf71bf5fe5f9889
2012-03-08 03:43:22 +00:00
Yuriy Taraday 01a938f7fe HACKING fixes, all but sqlalchemy.
Looks like this fixes all HACKING problems that were around.
Thanks to Dina Belova and Alexander Kovalev for this work.

Change-Id: I8157f0d4890184c1216aab63ef7180ee8b7a184d
2012-03-07 12:51:39 +04:00
Jenkins a231acabb6 Merge "Fixes bug 942556 and bug 944105" 2012-03-06 19:37:21 +00:00
Johannes Erdfelt c4a2e17dcf Retry download_vhd with different glance host each time
Fixes bug 944096

Change-Id: I33aa3774ba7f266e85f09c6c569fdd0f895478b4
2012-03-02 19:14:13 +00:00
John Garbutt 37a392dc4c Fixes bug 942556 and bug 944105
Ensures the calls in the xenhost plugin work when the host is in
a xenserver pool managed by the host aggregates feature.

Change-Id: I51ca6b9f6d0e8d86d53afde5bf46cfabde17a44e
2012-03-02 16:03:56 +00:00
Mark Washenberger 0d487d4f23 Copy data when migration dst is on a different FS
Fixes bug 939916

Change-Id: I678e15a13f99b59b16bd446f566b2c48dcba6057
2012-02-23 20:01:14 -05:00
Armando Migliaccio 939f082cc2 blueprint host-aggregates: host maintenance - xenapi implementation
this changeset introduces the following:

- refactoring around host-related operations for xenapi
- increased test coverage
- first cut at implementing host evacuation for a XS/XCP host

Change-Id: I8509cdde95f6777ecfa928663b0c4bedbccf5d38
2012-02-23 13:28:21 +00:00
Jenkins 60cec0a7f5 Merge "blueprint host-aggregates: improvements and clean-up" 2012-02-22 17:20:24 +00:00
Jenkins be56fd77ad Merge "Clarify use of Use of deprecated md5 library" 2012-02-22 16:53:11 +00:00
Armando Migliaccio 424de7eea2 blueprint host-aggregates: improvements and clean-up
This changeset addresses a number of issues found during testing:

- avoid name conflicts during aggregate creation (see db/* changes)
- avoid masking of XenAPI.Failure if pool-join fails (see plugins/* changes)
- preserve VM placement decisions made during scheduling (see xenapi/vmops.py)
- ensure plugins are called on the right hosts in XS pools (see xenapi_con.py)
- stores master uuid in aggregate metadata for use in VM live migration and
  raise InvalidAction rather than Aggregate error if we attempt to remove
  a mster (see xenapi/pool.py and compute/manager.py)
- clean-up of unit tests

Change-Id: I881a94d87efe1e81bd4f86667e75f5cbee50ce91
2012-02-22 10:40:09 +00:00
Jenkins c4ff7ef07c Merge "blueprint host-aggregates: xenapi implementation" 2012-02-22 03:22:30 +00:00
Armando Migliaccio 424f32f04d blueprint host-aggregates: xenapi implementation
This commit introduces some clean-up/improvements on the current model
and api for host aggregates. It also introduces a first version of the
xenapi implementation. More precisely:

- it lays out the structure of the virt driver,
- it introduces compute and xenapi unit tests coverage,
- it deals with join/eject of pool master and slaves,
- it fixes xenapi_conn, when used in resource pool configurations

More commits to follow (to ensure that VM placement, networking setup,
performance metrics work just as well in cases where resource pools
are present). However, these may be outside the scope of this blueprint
and considered as ad-hoc bug fixes.

Change-Id: Ib3cff71160264c5547e1c060d3fd566ad87337cb
2012-02-21 22:43:49 +00:00
Rick Harris 043347267b Avoid copying file if dst is a directory.
Fixes bug 938153

`shutil.move` in Python 2.4 will fallback to copying the file if dst is
a directory. See http://bugs.python.org/issue1577.

Change-Id: I2390337d82db5a72fef0e63877401134b1dcca55
2012-02-21 22:00:03 +00:00
Joe Gordon 1fc7c0c534 Clarify use of Use of deprecated md5 library
See Invalid bug 937463 for more details
Also change run_tests.sh to ignore more '*.pyc' files

Change-Id: I8c8ded902833fe4268966ff7a9630daaaad43a19
2012-02-21 09:06:08 -08:00
Johannes Erdfelt 3a95d451ed Catch httplib.HTTPException as well
Fixes bug 932927

None of the httplib exceptions will get converted into urllib2 exceptions

Change-Id: Iad72821fa1ed54fdb213b371223e94e183dec334
2012-02-15 18:52:40 +00:00
Devdeep Singh 6c3bc216c1 Changes for supporting fast cloning on Xenserver.
Implements blueprint fast-cloning-for-xenserver
	1. use_cow_images flag is reused for xenserver to check if copy on write images should be used.
	2. image-id is used to tag an image which has already been streamed from glance.
	3. If cow is true, when an instance of an image is created for the first time on a given xenserver, the image is streamed from glance and copy on write disk is created for the instance.
	4. For subsequent instance creation requests (of the same image), a copy on write disk is created from the base image that is already present on the host.
	5. If cow is false, when an instance of an image is created for the first time on a host, the image is streamed from glance and its copy is made to create a virtual disk for the instance.
	6. For subsequent instance creation requests, a copy of disk is made for creating the disk for the instance.
	7. Snapshot creation code was updated to handle cow=true. Now there can be upto 3 disks in the chain. The base disk needs to be uploaded too.
	8. Also added a cache_images flag. Depending on whether the flag is turned on on not, images will be cached on the host.

Change-Id: I54838a24b061c134877f3479c925c6ee78da14bc
2012-02-13 09:31:01 +05:30
Rick Harris 4cad8add20 Send image properties to Glance
Fixes bug 928549

Change-Id: Ie89e9c49c1fe25ed4acd680dd8c2c5e84173cdcd
2012-02-07 23:34:48 +00:00
Armando Migliaccio a5d5368a46 Bug #921730: plugins/xenserver/xenapi/etc/xapi.d/plugins/objectstore no longer in use
remove the plugin and update resources accordingly.

Change-Id: Ib4184c9b81b40e6892886c71fd8de09ba55322af
2012-01-26 14:09:26 +00:00
Vishvananda Ishaya 20b4d89512 Remove a whole bunch of unused imports
Change-Id: I6759e5b6250c48cc0deb4b198b44c948c64c47d1
2012-01-13 13:55:38 -08:00
Salvatore Orlando eac7888e72 Blueprint xenapi-security-groups
Provides two drivers for implementing security groups in xenapi:
1) domU driver that enforces security groups on the Openstack virtual appliance (use advised with FlatDHCP in HA mode)
2) dom0 driver that enforces security groups where VIFs are attached

Both drivers translate security groups into iptables rules.
Existing libvirt code has been refactored to reduce the amount of duplicated code to a minimum

Now Addressing reviewers's comments on style. Fixing issue spotted with snapshots
Change-Id: Ifa16a8f2508a709be03241bac0f942fe1a51d1e8
2012-01-10 17:16:31 +00:00
Dan Prince 93359c8476 Update glance Xen plugin w/ purge props header.
Update glance XenServer plugin to use X-Glance-Registry-Purge-Props.
Fixes LP Bug #908922.

Change-Id: I4d16fc8fb34e24195f3bc589d42bdbfadaf77398
2011-12-26 22:14:39 -05:00
Kevin L. Mitchell 6090313757 Updates OVS rules applied to IPv4 VIFs
Change-Id: I90cf18a6f60a792c184097f5eeea4282b58f85c5
2011-12-13 22:42:05 +00:00
Johannes Erdfelt c25f7e7e83 Implement resize down for XenAPI
This patch implements resizing an instance to a smaller disk. It implements
this by copying the VDI and running e2resize, before transferring to the
new host.

Change-Id: Ic901a59cb6cdb79605c70528cf85064d8335ee2f
2011-12-02 15:58:58 +00:00
Naveed Massjouni 9dbcd8bbc7 Replacing instance id's in in xenapi.vmops and the xen plugin with
instance uuids. The only references to instance id's left are calls to
the wait_for_task() method. I will address that in another branch.
blueprint: internal-uuids

Change-Id: I268706f2429e47195a97054187ff7da8c55e3719
2011-12-02 00:04:54 -05:00
Mark Washenberger a46e2a6e00 Workaround xenstore race conditions
Change-Id: I17791a78c2008e1bdc41f4f658200808ee72629c
2011-11-18 17:37:48 -05:00
Jenkins 7c34941b89 Merge "Add logging, error handling to the xenstore lib." 2011-11-16 21:19:31 +00:00
Rick Harris 84ac4d84ab Replacing disk config extension to match spec.
Related to instance-disk-management blueprint.

Change-Id: I84689583562f23356064a502577b2924bcbbc460
2011-11-16 14:12:03 -06:00
Mark Washenberger c51104ab01 Add logging, error handling to the xenstore lib.
Change-Id: If007ba117105d63b1eecfee5b8941d98032d2c9a
2011-11-15 16:21:54 -05:00
Ewan Mellor f11f6f789e Bug #888719: openvswitch-nova runs after firstboot scripts
Move openvswitch-nova to 23 in the boot order.

The openvswitch-nova init.d script used on XenServer has been set to run
at 96 in the boot order (i.e. very late).  This is inconvenient, because it
means that it runs after the firstboot scripts, so if you want to do an
automated install of a compute VM, say, you can't rely on the Open vSwitch
rules being ready.

23 places it after the networking start up (9 through 14) and before the
firstboot scripts (24).

Change-Id: I5c4f2f02c78bd7b8ccc6cac4d6549209a6dcbdb0
2011-11-11 11:53:05 -08:00
Mark Washenberger 89f2fb00b9 Add more error handling to glance xenapi plugin
Also add some extra logging to help track down problems that occur
when getting images from glance.

Change-Id: I2246d06364211ae377c7a89f93a76f339a201a8d
2011-11-10 10:41:29 -05:00
Brian Lamar 9a32891107 Switch glance XenAPI plugin to use urllib2.
Currently the plugin uses httplib which does not handle redirects
natively. XenAPI plugins require Python 2.4+ so using httplib2
as far as I know is not a possibility.

(Patch Set 2) Oops, forgot to PEP8 before putting up for review.
(Patch Set 3) Updated logging to be more verbose as per Waldon

Change-Id: I189093fe26dfee30b5b8b3c0f2c21a35fbfbc05e
2011-11-08 11:17:41 -05:00