Commit Graph

323 Commits

Author SHA1 Message Date
Jenkins b3e097a0f4 Merge "Adds retry on upload_vhd for xapi glance plugin" 2013-03-04 16:54:13 +00:00
Nicholas Kuechler 2db1a0f62b Adds retry on upload_vhd for xapi glance plugin
Add a retry for the xapi glance plugin to handle transient issues
when uploading the vhd.

An example issue we're seeing is a connection timeout:

['XENAPI_PLUGIN_FAILURE', 'upload_vhd', 'error',
		"(110, 'Connection timed out')"]

To work around transient issues such as a connection timeout, we
should retry based on glance_num_retries before outright failing.

Change-Id: Ice6fdd3dd39ef40e5997d69209aaafa66bff5d6e
Fixes: bug #1134493
2013-02-27 17:01:01 -06:00
Kurt Taylor d17f9ab13d Update OpenStack LLC to Foundation
Update all references of "LLC" to "Foundation".

Change-Id: I009e86784ef4dcf38882d64b0eff484576e04efe
2013-02-26 19:15:29 -05:00
Rick Harris 0a93b563e9 Harmonize PEP8 checking between tox and run_tests.sh
Tox and run_tests.sh were running PEP8 checks against different
file-sets. This patch refactors the logic to determine which files to
run PEP8 checks on into `tools/run_pep8.sh` where it can be called by
both tox and `run_tests.sh`.

Additional fixes:

Some of our Python XenAPI Dom0 plugins don't end in *.py but should
still be checked by PEP8. This patches fixes the hacking.py violations
in the files and adds them back to the srcfiles list.

Merged tools/unused_imports.sh into tools/run_pep8.sh

Change-Id: Id5edd1acb644ab938beffc3473494a179d9d8cda
2013-02-15 00:39:58 +00:00
Pádraig Brady f379db545c fix misspellings in logs, comments and tests
Flagged with: https://github.com/lyda/misspell-check
Run with: git ls-files | misspellings -f -

Fixes bug: 1100083
Change-Id: Icf1f844fea8ad0a1101d1dc64b9a126608e9536e
2013-01-21 23:14:13 +00:00
Sean Dague 5fca1d9e97 fix new N402 errors
fix the N402 errors that have slipped in in the last 48 hrs since
starting this patch series.

fix an N401 error that our scanner current can't find because it
only looks for doc strings on classes and defs.

this is the xeno's paradox of patch series, but we're getting close.

Change-Id: I4a763bb4c812335d853eae05c72464f18ab93297
2013-01-10 08:57:09 -05:00
Monsyne Dragon 65644195fe Fix bandwidth polling exception.
When the bandwidth polling task tries to update bw usage for an
instance that does not have an entry for the last two periods already
in the bw_usage_cache table, it will throw an exception in the
polling task. This was just a misses 'if' statement.

Also:
xenserver: fix swapped bw data in xs plugin.

This fixes bug 1075255

Change-Id: I44bb143039fcdfc8dacb13b67ae8f79dc5f38777
2012-11-05 17:46:55 +00:00
Rick Harris 216a83da47 Add ability to download images via BitTorrent.
This patch adds a new dom0 plugin which supports downloading images via
BitTorrent. Torrent metadata files are assumed to be served from a
webserver which is specified by the `torrent_base_url` config.

Under the hood, the dom0 plugins calls out to rasterbar's libtorrent via
Python bindings in order perform the initial download as well as the
seeding thereafter.

Implements BP xenserver-bittorrent-images

Change-Id: I824720a6e3a37317080a22cd7405d2a88172c3ef
2012-10-03 21:29:46 +00:00
Jenkins d399c75568 Merge "xenapi: Removing legacy swap-in-image." 2012-10-01 21:56:20 +00:00
Brian Lamar 84a9af7966 Update RPM SPEC to include new bandwidth plugin.
RPM builds will fail until this line is added to include
the new plugin.

Fixes bug 1059772

Change-Id: I06d78cf199d4cb580003e4c220af3efc8dbe437c
2012-10-01 14:26:19 -04:00
Jenkins 2377d6a7b6 Merge "Fix XenServer's ability to boot xen type images" 2012-09-30 07:35:54 +00:00
Jenkins 7104362abb Merge "Collect more accurate bandwidth data for XenServer" 2012-09-29 01:54:55 +00:00
Rick Harris a36288351a xenapi: Removing legacy swap-in-image.
This patch removes our legacy handling of swap in the image. Now that
we're generating swap on-the-fly, this stop-gap solution can go away.

Change-Id: Ied3198f77af8dabb6cfbf2ab9cfb3a4eb18e32ea
2012-09-26 15:47:25 +00:00
Johannes Erdfelt fe478bd49f xenapi: increase timeout for resetnetwork agent request
Windows can take longer than the default 30 seconds for resetnetwork
requests. Double the timeout for the command to 60 seconds, but add
a flag so it can be changed without code changes in the future.

At the same time, add a flag for all other agent requests too.

Change-Id: Iba91c37fd5596ea0dd63c20f74925972df1ca715
2012-09-26 15:42:52 +00:00
Monsyne Dragon 8887f10c66 Collect more accurate bandwidth data for XenServer
This changes the method used to poll xenserver for bandwidth data.
The reccomended way of collecting such data from xenserver (namely the
RRD files provided by the hosts) do not seem to be reliable, they
will sometimes be correct, often will be signifigantly under (> 10%),
and occasionally will show artifacts, such as phantom 4gb bandwidth
'spikes'.

This patch changes that to use the much simpler method of simply polling the
byte counters on the VIF network devices on the host. (We have old non-nova
code that does that on xenserver, and that method is known to work).

This should also make it much easier for other hypervisors other than
xenserver to implement bandwidth polling, as polling the counters is a rather
more universal method.

Fixes bug 1055737

Change-Id: I6a280d8bbfcc74914f888b11bc09349a270a5f58
2012-09-25 20:36:55 +00:00
Mate Lakat 25b2062b47 Fix XenServer's ability to boot xen type images
Fixes bug 1055431.

As the scheduler wants to boot a vm_mode=xen type of image, the host's
"supported_instances" capability is used for finding a good candidate.
In the Xapi case, this field was not populated.

This fix modifies the xapi xenhost plugin, so the Xen host capabilities
are returned back to the compute node, as "host_capabilities".
On the compute side, the mentioned information is used, to extract the
"supported_instances" information.

Change-Id: I2da11ab81f74b5b52e2c30832a694470978e21b0
2012-09-25 16:00:31 +01:00
Rick Harris 6392ad2924 xenapi: Make dom0 serialization consistent.
The dom0 plugin code had been using `pickle` for serializing input and
`json` for serializing output which was needlessly inconsistent. This
patch makes the code use `pickle`--chosen for its better handling of
`datetime` objects--for both sending and receiving data.

This patch also refactors the code so that neither the caller nor the
callee need to explicitly worry about serialization: the caller just
passes in args and kwargs, and the callee's function signature just
accepts the args and kwargs as usual.

Bonus: Removes unecessary imports

Change-Id: I3abb42eeebd8d37d67e6c26fa7bcae66d876b3ee
2012-09-07 21:27:24 +00:00
Vincent Untz fa5be443ba Allow connecting to a ssl-based glance
This introduces a new glance_api_insecure setting that can be used to
not verify the certificate of the glance server against the certificate
authorities.

Fix bug 1042081.

Change-Id: I0a9f081425854e9c01e00dfd641e42276c878c67
2012-08-27 08:48:18 +02:00
Joe Gordon b0392d3017 OpenStack capitalization added to HACKING.rst
Along with capitalization fixes to comments in code

Change-Id: I72ddc582001f80d954ca5a121903c689f40d08d1
2012-08-17 15:59:32 -05:00
Jenkins 600a3bd10d Merge "xenapi: reduce polling interval for agent" 2012-08-09 04:48:46 +00:00
Johannes Erdfelt fbb7944851 xenapi: reduce polling interval for agent
Communicating with the agent requires polling for a response. The
operation uses xenstore, which is lightweight, yet the interval
in between polls was 3 seconds. This would cause longer than necessary
sleeps when an instance was booting making the overall boot slower.

Change-Id: I560c05887128f1a0e29228e859cca25ded4eceec
2012-08-07 23:25:57 +00:00
Johannes Erdfelt 31f3383ae4 xenapi: wait for agent resetnetwork response
Unlike every other agent command, the resetnetwork command would not
wait for a response. All failures were silently ignored. Change this
to at least log a message if an error occurs.

Change-Id: I40e323607b2ce50869f3bf11e4582ff83cbed1c0
2012-08-07 23:19:04 +00:00
Jenkins 56a5ba1170 Merge "XenAPI: Fix race-condition with cached images." 2012-08-01 15:49:59 +00:00
Jenkins 794a673b05 Merge "Fix ip6tables support in xenapi bug 934603" 2012-08-01 07:19:11 +00:00
Rick Harris 4f3291e379 XenAPI: Fix race-condition with cached images.
The core problem is that XenServer's `VDI.copy` call drops the
destination file directly into the SR. This means that half-completed
files are visible with no way to distinguish these from fully-copied
files.

We had some code that attempted to mitigate this issue by checking
physical_utilisation against an expected value. The problem with this
code is that it didn't account for VDI chaining where the
physical_utilisation would not necessarily match the parent.

The net effect of this was that 'cloned' VDIs would never be found
because their physical_utilisation was far below what was expected.

The work around is to create our own `_safe_copy_vdi` which is isolated
and atomic. Long term, `VDI.copy` should be fixed so that half-completed
files are never stored in the SR.

Change-Id: I6eb3cb5259f9ee1c7394e58f76105a8b39bfc720
2012-08-01 04:49:37 +00:00
Rick Harris 40a84de65a Xen: VHD sequence validation should handle swap.
The VHD sequence validation code was erroneously counting `swap.vhd`,
which caused it to raise an exception when a corresponding numbered VHD
was not found.

The fix is to simply ignore the `swap.vhd` file.

Other unknown VHDs will generate an exception, but from a
sanity-checking perspective, this is a Good Thing(tm).

Fixes bug 1030939

Change-Id: Ic82ae27a4af7ea8f7669fd006aea1a310b691218
2012-07-30 15:49:02 +00:00
Mate Lakat cdc5a6a237 Fix ip6tables support in xenapi bug 934603
Change-Id: Id7c4b0c4f8710652249b5c4fcb82abd5cccde6dd
2012-07-27 14:41:56 +01:00
Rick Harris dd54a15a7f Xen: Validate VHD footer timestamps.
This is a sanity check to ensure the footer timestamps on a VHD are
reasonable (e.g. not in the future). This condition can occur if the
local time for the source and destination machines in a migration are
not in agreement, requiring an adjustment to /etc/localtime and/or NTP
reconfiguration.

Without this check there is a risk of importing a corrupt VHD into the
SR causing the entire SR to become corrupted.

Change-Id: I17228e50d6f54632f3bfc32a682e511f876517ec
2012-07-24 18:26:57 +00:00
Jenkins 075cd48847 Merge "Adds logging for renaming and hardlinking." 2012-07-20 20:11:52 +00:00
Rick Harris d42f44f1e4 Adds logging for renaming and hardlinking.
This will provide a bit more visibility into what's happening when dom0
plugin generates an exception.

Change-Id: Ia529956ee4fc56e49efdcf2cca4f42fc8ebcc3ea
2012-07-20 17:34:43 +00:00
Rick Harris 4881ccf017 Ensure VHDs in staging area are sequenced properly.
This adds a check to raise a sensible error if the VHDs in the staging
area are not sequence numbered properly, meaning 0 to n-1 with no gaps.

The previous error was an UnboundLookupError which made it difficult to
pinpoint the root cause.

Change-Id: I6b9e4f854c271bf73711480568be384ba883775d
2012-07-19 22:52:30 +00:00
Rick Harris f5583a7840 Remove VDI chain limit for migrations.
The strategy for removing the limit is to refactor migration so that
they work nearly identically to snapshots, meaning sequence-numbered
VHDs are rsynced over into a staging-area and then imported into the SR
using the `import_vhds` function.

Change-Id: Ibf5c82c52ae7d505ea9e54d64fcc8b8fdce4d05d
2012-07-16 11:49:15 -04:00
Jenkins e4ac606dd5 Merge "Use explicit destination user in xenapi rsync call" 2012-07-13 20:05:31 +00:00
Johannes Erdfelt d906692f78 Use explicit destination user in xenapi rsync call
Recent versions of xenserver use a newer, but buggy, version of rsync
that will attempt to parse out the username and fail if it isn't in
the destination. So, add it to the destination to ensure this works
with both older and newer versions of rsync.

Change-Id: I9b7f05a8ea5cf5b7fae1a55a2b8557b2bfe5b865
2012-07-13 16:52:29 +00:00
Rick Harris 45f8aefcd3 Remove VDI chain limit for snapshots.
Snapshots and migrations were coded with a simplifying assumption that
the maximum length of a VDI chain would be 3. Now that fast-cloning has
been added, this assumption no longer holds.

The goal of this patch is to remove the restriction for snapshots. A
follow-on patch will remove the restriction for migrations.

This patch changes the image-format for XenAPI images. Instead of naming
the VHDs, 'base', 'image', and 'snap', they are now numbered staring
with 0 as the leaf and going to N as the base-copy (root).

Old-style images are still supported.

Change-Id: Ieb073b42dc25db7cee4dfca7ff6525f7e7f46e8e
2012-07-12 18:02:32 -05:00
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