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
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
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
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
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
This will provide a bit more visibility into what's happening when dom0
plugin generates an exception.
Change-Id: Ia529956ee4fc56e49efdcf2cca4f42fc8ebcc3ea
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
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
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
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
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
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
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
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
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
`utils.py` was added by the Dom0 plugin refactoring but the
corresponding declaration in the SPEC file was forgotten.
Change-Id: If12d7389a51928b1f741063e12b3b5a9015d0656
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
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
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
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
Looks like this fixes all HACKING problems that were around.
Thanks to Dina Belova and Alexander Kovalev for this work.
Change-Id: I8157f0d4890184c1216aab63ef7180ee8b7a184d
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
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
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
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
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