Jon Ludlam [Fri, 24 Sep 2010 16:27:30 +0000 (17:27 +0100)]
Local disk caching API work. Added pool-level API calls to enable/disable caching, host-level API calls for same, per VDI on_boot and allow_caching parameters, and CLI calls for all.
Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
Jon Ludlam [Fri, 24 Sep 2010 15:46:04 +0000 (16:46 +0100)]
Pass the writable flag to the SM backends on activate as well as attach. This is a temporary fix to work around
an implementation hurdle in the backends.
Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Ted M Lin [Wed, 4 Aug 2010 19:55:23 +0000 (15:55 -0400)]
MAR-112: RRD transfer lock can prevent master transition
If the master loses connectivity during a RRD transfer, the RRD mutex
will never be released. When performing a emergency master transition,
the first thing that occurs is to save the local RRDs to disk, which
requires the RRD mutex. This will never succeed, thus XAPI gets stuck
trying to shut down.
Instead of locking the mutex, we try to acquire it for a few seconds.
If the lock can not be taken, the loss of some RRD data is preferable
to not being able to transition at all.
Signed-off-by: Ted M Lin <tlin@marathontechnologies.com>
Rob Hoes [Mon, 23 Aug 2010 12:23:55 +0000 (13:23 +0100)]
Startup function to execute an emergency network reset
This patch contains the code that is able to perform an emergency network reset. The code runs when xapi starts and the file /tmp/network-reset (created by the xe-reset-networking script) is present.
Rob Hoes [Mon, 23 Aug 2010 12:23:54 +0000 (13:23 +0100)]
Add host.reset_networking API call
This call purges all network-related metadata associated with the given host (PIFs, VLANs, bonds, tunnels). This call is used by the emergency network reset functionality. It should normally not be used directly, and is hidden from the API docs.
David Scott [Mon, 23 Aug 2010 12:16:56 +0000 (13:16 +0100)]
CA-43021: hook in 'sparse_dd' for improved VM.copy performance
On local LVHD, VM.copies of freshly installed guests are much quicker:
Guest Previous VM.copy time New VM.copy time Speedup
----------------------------------------------------------------
Debian Lenny 2:11 1:18 40%
Windows 7 14:18 7:57 44%
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott [Mon, 23 Aug 2010 12:16:50 +0000 (13:16 +0100)]
CA-43021: More refactorings of the sparse_dd binary.
Split the DD operation into a 'fold' and a 'copy' (where the latter contains the side-effects, computes stats etc)
Move the substring record type into the Zerocheck module.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott [Mon, 23 Aug 2010 12:16:49 +0000 (13:16 +0100)]
CA-43021: Small refactorings of the new sparse_dd code.
Split the 'Stream' signature into two since we don't have to be reading and writing to the same kind of data.
Add a convenient 'substring' record type rather than passing around multiple arguments all the time.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott [Mon, 23 Aug 2010 12:05:49 +0000 (13:05 +0100)]
CP-1884: The pool master should forward VDI.copy calls to a host which can see the source SR; now that we have cross-host copying it isn't necessary to be able to find a host which can see both the source and destination SRs.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott [Mon, 23 Aug 2010 12:05:47 +0000 (13:05 +0100)]
CP-1883: Allow raw VDI import to receive an export-like chunked encoding.
The raw VDI import HTTP handler currently assumes the whole disk is being uploaded at once. Instead we add a 'chunked' mode which allows arbitrary-sized disk blocks to be selectively uploaded.
Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Rob Hoes [Wed, 14 Jul 2010 15:44:47 +0000 (16:44 +0100)]
Update firstboot network data before pool eject
When a host is ejected from a pool, its XAPI database objects are removed and recreated by the firstboot scripts after the host reboots. The data used by the firstboot scripts is stored when the host is installed, and never updated anymore after that. Part of the firstboot data is the assignment and IP configuration of the management interface.
This patch updates the firstboot data to reflect the current configuration of the management interface on pool eject, such that after the reboot, management is configured in the same way as before. As pool eject removes any bonds, in case management is on a bond, one of the slaves is chosen to become the new management interface.
Rob Hoes [Wed, 14 Jul 2010 15:44:47 +0000 (16:44 +0100)]
Introduce PIF.scan_bios
This function is similar to PIF.scan, but uses biosdevname to determine the device names of the network interfaces. The patch also add an extra check to the PIF introduce code to ensure that no new PIF is created if one already exists with the same device name.
Rob Hoes [Wed, 14 Jul 2010 15:43:32 +0000 (16:43 +0100)]
Rewrite feature restrictions code
This patch replaces restrictions.ml by features.ml and editions.ml, and splits up license.ml in three separate files (license.ml, license_init.ml and license_file.ml).
The Features module controls which XCP features are enabled. The Editions module defines "editions", which are sets of features that are enabled. An XCP host is always running as (exactly) one particular edition. Currently, there is just one edition defined, called "Free" (for backwards compatibility), in which all currently implemented features are enabled.
One use of this is that new or experimental features can be enabled only in special editions to keep them separate from the stable version of XCP.
From 92e906e484fac90d5c5618f2bca33f595ad2e390 Mon Sep 17 00:00:00 2001
Date: Wed, 23 Jun 2010 09:18:57 +0100
Only the vswitch backend is able to implement CHIN.
Rob Hoes [Wed, 14 Jul 2010 15:43:28 +0000 (16:43 +0100)]
Tunnelling: synchronise tunnels with the pool master when a slave starts up
Just like for bonds and VLANs, tunnels should be synchronised with the pool master and all pool slaves. This code ensure that tunnels are synchronised when xapi starts up on a slave, which is especially important after a pool join.
Rob Hoes [Wed, 14 Jul 2010 15:43:28 +0000 (16:43 +0100)]
VSwitch controller field may be blank on pool join
If the pool.vswitch_controller field is blank on a joining host, but not on the pool, the join is allowed. The openvswitch in the joining host will be controlled by the pool's controller.
Zheng Li [Wed, 16 Jun 2010 15:26:42 +0000 (16:26 +0100)]
Some minor improvements to the with-vdi script
- return the user command's exit code as the exit code of with-vdi script (unless something else failed in the preparation or post run steps)
- relax the requirement on the user command parameter, both absolute paths and in-paths executables are acceptable
- allow a user command to have its own arguments (i.e. with-vdi vdi-uuid user-command arg1 arg2 ... argn)
Alex Zeffertt [Thu, 8 Jul 2010 13:54:31 +0000 (14:54 +0100)]
Coalesce RHEL/CentOS/OEL 5.x templates into one template per distro per arch
Create 6 new templates (RHEL,CentOS,OEL)*(i386,x86_64) that can be used to
install 5.x point release.
For now we leave the old templates in place to prevent a failure in the
regression testing. However, when XenRT has been updated to use the new
templates we shall remove the old ones.
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Rob Hoes [Thu, 8 Jul 2010 13:50:44 +0000 (14:50 +0100)]
Improve import of networks/VIFs on pool join
Metadata export+import is used to recreate VIFs on the pool, when a host joins. VIFs are linked to networks on the receiving pool by matching the name_label of the network on the two pools. If the name_label does not exist, this has to be because an existing physical network on the receiving pool is used; in this case, we match on bridge name. This is a sensible fall-back option for imports in general.
Rob Hoes [Thu, 8 Jul 2010 13:47:51 +0000 (14:47 +0100)]
Improve network recreation on pool join
When joining a new host to a pool:
* Networks of physical interfaces are copied to the pool's DB if they do not yet exists; matching is done based on the bridge name (xenbr0, xenbr1, ...).
* All other networks are recreated on the pool. The bridge (xapi0, xapi1, ...) is renamed such that it is unique on the pool. All other network fields are copied from the host's network object.
Ian Campbell [Thu, 8 Jul 2010 13:35:13 +0000 (14:35 +0100)]
vswitch: pass network uuid to vswitch when creating an internal network
For external networks this is taken care of by interface-reconfigure
but in the internal network case there is currently no callout so
simply pass the network uuid when creating calling out to create the
bridge.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Ben Pfaff [Thu, 8 Jul 2010 13:33:34 +0000 (14:33 +0100)]
[PATCH] xenserver: Avoid errors from ovs-vsctl at system shutdown.
From ab32de001f10ddcb119360744c078ed9c1aebb06 Mon Sep 17 00:00:00 2001
Date: Fri, 25 Jun 2010 13:57:22 -0700
Commit 823c5699 "interface-reconfigure: callout to datapath backend class
method on rewrite" changed "interface-reconfigure rewrite" to update
bridge external-ids in the vswitch database. But this had the side effect
of causing errors at system shutdown, since ovsdb-server gets shut down
before the rewrite action is called. This commit fixes the problem by
skipping the update if the database socket does not exist. (It's just
fine to skip the update, since the external-ids will be re-set the next
time the system boots anyhow.)
This commit fixed the problem on 5.6.810-34773p for me. I don't see the
problem at all on 5.5.0. Presumably system shutdown order has changed.
Ben Pfaff [Thu, 8 Jul 2010 13:33:26 +0000 (14:33 +0100)]
[PATCH] xenserver: Kill bond master's dhclient when bringing up bond slave.
From fe19e820e4e543ee29b1b159be8ef8ee03947650 Mon Sep 17 00:00:00 2001
Date: Mon, 28 Jun 2010 10:34:10 -0700
interface-reconfigure is never explicitly called to down a bond master.
However, when it is called to up a slave it is implicit that we are
destroying the master. The "bridge" version of interface-reconfigure
always "ifdown"s the bond master in such a case, but until now the
"vswitch" version has not done so. Usually, it doesn't matter, because
the bond master network device disappears when the slave is brought up,
but one case was missed: for a bond master with an IP address obtained
via DHCP, the dhclient process needs to be killed, and we were not doing
it. This commit starts doing it (by invoking ifdown on the bond master).
The dhclient process that hangs around doesn't cause problems until the
bond master is brought back up, at which point "ifup" fails because it
refuses to start another dhclient for the same interface.
The converse behavior is also important; that is, when a bond PIF is
brought up, interface-reconfigure is expected to implicitly take down its
slave PIFs. My testing (on 5.5.0) shows that this behavior is already
correct. At any rate, this commit does not change that behavior.
Ian Campbell [Thu, 8 Jul 2010 13:33:23 +0000 (14:33 +0100)]
[PATCH] interface-reconfigure: callout to datapath backend class method on rewrite
From 823c5699d4de7bf726f988e1ca6197fb2400f388 Mon Sep 17 00:00:00 2001
Date: Fri, 4 Jun 2010 16:39:10 +0100
Use this mechanism to allow the vswitch backend to update the vswitch
configuration's mapping from datapath to XenAPI datamodel Network
UUIDs. The vswitch needs a mechanism to update these when they change
(i.e. on pool join and eject).
Refactor the DatapathFactory method to return the class which the
caller can instantiate or not as the require.
[PATCH] xenserver: Clean-up space/tabs issues in vif script
From 291a0f6b6e05fe5be28b935436abb5a958334885 Mon Sep 17 00:00:00 2001
Date: Wed, 21 Apr 2010 03:53:22 -0700
Our vif script had a mishmash of tab and space indentations. The
original vif script only uses spaces, so I went with that style.
[PATCH] xenserver: Set internal network-uuids in Bridge table on XS5.5
From 79eb8b002c588e6f7495a0cd73d8a0597a458442 Mon Sep 17 00:00:00 2001
Date: Wed, 21 Apr 2010 03:42:52 -0700
On XenServer 5.5, interface-reconfigure is not called when creating
internal bridges, so we jump through extra hoops to determine the
network UUIDs. The code that handled this was not properly retrieving
the UUIDs from XAPI, so the field would never be set. This commit
corrects that.
Ian Campbell [Thu, 8 Jul 2010 13:32:31 +0000 (14:32 +0100)]
[PATCH] xenserver: strip all alpha-suffixes from the xenserver build number.
From 2c0f11dc7e66e10257ef927574a99d5f888c774c Mon Sep 17 00:00:00 2001
Date: Thu, 1 Apr 2010 10:45:22 +0100
The letter at the end of the build number indicates the site where the build
was done. All publicly released builds come from "p" but within Citrix we have
other suffixes (i.e. in Cambridge we get c).
[PATCH] Cleanup default file locations and XenServer packaging
From bc39196036f8e33d15274855087f0c47be2095ee Mon Sep 17 00:00:00 2001
Date: Thu, 25 Mar 2010 22:38:13 -0700
This commit cleans up the locations of a number of files and directories
used. These include:
- Config file lives in /etc/openvswitch/conf.db
- Logs go into /var/log/openvswitch
- ovsdb-server socket is /var/run/openvswitch/db.sock
- Schema goes into /usr/share/openvswitch/vswitch.ovsschema
- PID files go in /var/run/openvswitch
For XenServer, these additional changes are made:
- Cores go in /var/xen/openvswitch
- OVS binaries run in /var/xen/openvswitch
In addition, it attempts to cleanup the XenServer packaging. This
includes referring to the project as "openvswitch" as opposed to the
somewhat presumptuous "vswitch".
Note: Changes to the Debian packaging will be forthcoming.
Ian Campbell [Thu, 8 Jul 2010 13:31:27 +0000 (14:31 +0100)]
[PATCH] xenserver: Ensure that Bridge.other-config:hwaddr and Interface.MAC are set as appropriate.
From 16f2ae571fc7d21f13c9ddbe4e948d8f35552ae5 Mon Sep 17 00:00:00 2001
Date: Fri, 26 Mar 2010 09:35:32 -0700
Otherwise bridges can end up with a generated MAC address using Nicira OID
which has an impact when using DHCP on that devices.
tests/interface-reconfigure.at updated by Ben Pfaff.
Ben Pfaff [Thu, 8 Jul 2010 13:31:26 +0000 (14:31 +0100)]
[PATCH] vswitchd: Make names of Bridge external_ids generic.
From 5c43922c13983d2b5addf9e6dd3f54a006c568a6 Mon Sep 17 00:00:00 2001
Date: Thu, 18 Mar 2010 09:37:31 -0700
Until now the names of the external_ids keys used for Bridge records have
implied that they are specific to XenServer, because they begin with "xs-".
They are more generic in intent, however, so this commit removes the "xs-"
prefix and explains them more generically.
This finishes the renaming process started in commit c0f9490 "vswitchd:
Make names of Interface external_ids generic."