ganeti-local
10 years agoBump new upstream version debian/2.8.2+snapshot1+b64v1+hotplug3+ippoolfix+rapifix+netxen-1wheezy
Dimitris Aragiorgis [Fri, 22 Nov 2013 15:06:35 +0000 (17:06 +0200)]
Bump new upstream version

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoMerge branch 'stable-2.8-latest' into debian-2.8
Dimitris Aragiorgis [Fri, 22 Nov 2013 15:04:37 +0000 (17:04 +0200)]
Merge branch 'stable-2.8-latest' into debian-2.8

10 years agoDo not pass None values in network scripts
Dimitris Aragiorgis [Fri, 22 Nov 2013 14:19:28 +0000 (16:19 +0200)]
Do not pass None values in network scripts

RunCmd does not allow env dict to have non string values.
NIC's IP and name can be None, thus export them only if not.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoAdd missing opcode parameter
Dimitris Aragiorgis [Fri, 22 Nov 2013 13:02:12 +0000 (15:02 +0200)]
Add missing opcode parameter

Upon porting the patch from stable-2.10 where opcodes are
auto generated we forgot to add hotplug_if_possible param
to OpInstanceSetParams.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoSome minor fixes related to network scripts
Dimitris Aragiorgis [Fri, 22 Nov 2013 10:24:19 +0000 (12:24 +0200)]
Some minor fixes related to network scripts

Export NIC's name and uuid in configuration scripts, use HooksDict()
in Xen hypervisor to export network related vars, use GetTags()
instance method instead of directly accessing tags slot, and fix a
bug in net-common script for the routed mode.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoDocument vif-ganeti usage
Dimitris Aragiorgis [Wed, 26 Jun 2013 14:38:18 +0000 (17:38 +0300)]
Document vif-ganeti usage

In order to be able to use it as vif-script one has to
create a symbolic link inside /etc/xen/scripts pointing
to /usr/lib/ganeti/vif-ganeti and then add is a hypervisor
parameter.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoRefactor NIC configuration scripts
Dimitris Aragiorgis [Wed, 26 Jun 2013 14:38:16 +0000 (17:38 +0300)]
Refactor NIC configuration scripts

Add new script vif-ganeti that could be used instead of
default vif-bridge in order NIC customization can be more
flexible.

Extract common code from kvm-ifup and insert it in a new
file net-common that is being sourced by kvm-ifup and
vif-ganeti and located under package lib dir (/usr/lib/ganeti/).

Install vif-ganeti properly with make under /usr/lib/ganeti too.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoMake NIC setup more flexible in case of Xen
Dimitris Aragiorgis [Wed, 26 Jun 2013 14:38:15 +0000 (17:38 +0300)]
Make NIC setup more flexible in case of Xen

For every NIC write down a file that contains NIC's
info (MAC, mode, link, network details), that can
be sourced by any vif script.  The file location is:
/var/run/ganeti/xen-hypervisor/nic/<domname>/<nicidx>.

This file is created upon cfg file creation and before
starting the instance and can be sourced by an external
script. Before file creation ensure that all parent dirs
exist.

Cleanup NIC dir when removing config files. Upon Xen
configuration file removal, remove NIC dir as well.

Add new hv param vif_script that allows execution of
user defined networking script and overrides the one
xend is configured with in xend-config.sxp

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoExport nic name and uuid in configuration scripts
Dimitris Aragiorgis [Fri, 22 Nov 2013 09:57:10 +0000 (11:57 +0200)]
Export nic name and uuid in configuration scripts

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoBump new upstream version debian/2.8.2+snapshot1+b64v1+hotplug2+ippoolfix+rapifix-1wheezy
Dimitris Aragiorgis [Thu, 21 Nov 2013 14:38:30 +0000 (16:38 +0200)]
Bump new upstream version

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoMerge branch 'stable-2.8-latest' into debian-2.8
Dimitris Aragiorgis [Thu, 21 Nov 2013 14:37:50 +0000 (16:37 +0200)]
Merge branch 'stable-2.8-latest' into debian-2.8

10 years agoIntroduce --hotplug-if-possible option
Dimitris Aragiorgis [Tue, 19 Nov 2013 13:34:21 +0000 (15:34 +0200)]
Introduce --hotplug-if-possible option

This will be useful for an external entity using RAPI that
wants to modify devices of instances.

The common use case for that is:
"I want to add a NIC/disk to an instance. If it is running
then try to hotplug the device. If not, then just add it to config."

Another use case is that if we are unaware of the instance's
hypervisor: "I want do add a NIC/disk to an instance and if
its hypervisor is KVM try to hotplug it."

For all those cases just print a warning in CheckPrereq() and
disable any further hotplug related actions (and let
modifications take place after reboot).

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoFix a bug in BlockDevAssemble
Dimitris Aragiorgis [Thu, 21 Nov 2013 13:42:19 +0000 (15:42 +0200)]
Fix a bug in BlockDevAssemble

If BlockdevAssemble() is invoked with as_primary=False
(currently only in the first pass of AssembleInstanceDisks())
then _RecursiveAssembleBD() returns True. In this case we
must return a dummy True, True in the backend method.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoBump new upstream version debian/2.8.2+snapshot1+b64v1+hotplug+ippoolfix+rapifix-1wheezy
Dimitris Aragiorgis [Tue, 19 Nov 2013 14:38:43 +0000 (16:38 +0200)]
Bump new upstream version

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoMerge branch 'stable-2.8-latest' into debian-2.8
Dimitris Aragiorgis [Tue, 19 Nov 2013 14:37:01 +0000 (16:37 +0200)]
Merge branch 'stable-2.8-latest' into debian-2.8

10 years agoDo not abort if hotplug is not supported
Dimitris Aragiorgis [Tue, 19 Nov 2013 13:06:35 +0000 (15:06 +0200)]
Do not abort if hotplug is not supported

This will be useful for an external entity using RAPI that
wants to do device modifications to instances.

The common use case for that is:
"I want to add a nic/disk to an instance. If it is running
then hotplug the device. If not, then just add it to config."

Another use case is that if we are unaware of the instance's
hypervisor: "I want do add a nic/disk to an instance and if
its hypervisor is KVM try to hotplug it."

For all those cases just print a warning in CheckPrereq and
disable any further hotplug related actions (and let modifications
take place after reboot).

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoSome changes in control file
Dimitris Aragiorgis [Tue, 19 Nov 2013 09:18:17 +0000 (11:18 +0200)]
Some changes in control file

ganeti-haskell replaces snf-ganeti because
/usr/share/man/man8/ganeti-confd.8.gz was in ganeti 2.6 but now in
ganeti-haskell.

snf-ganeti recommends qemu-kvm or xen or qemu so that if
kvm is already installed do not install xen.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoganeti -> snf-ganeti in debian/rules
Dimitris Aragiorgis [Wed, 13 Nov 2013 14:59:02 +0000 (16:59 +0200)]
ganeti -> snf-ganeti in debian/rules

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoUse base64 encoding in networks' bitarrays
Dimitris Aragiorgis [Wed, 2 Oct 2013 19:36:54 +0000 (22:36 +0300)]
Use base64 encoding in networks' bitarrays

This is needed for GRNET'S production environment.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoSnapshot support for ExtStorage
Dimitris Aragiorgis [Wed, 16 Oct 2013 18:46:25 +0000 (21:46 +0300)]
Snapshot support for ExtStorage

Extend existing RPC params with the snapshot name and
add allow snapshot not only for LVM but also for EXT.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoDo not remove disks if --keep-disks and DT_EXT
Dimitris Aragiorgis [Thu, 17 Oct 2013 15:47:18 +0000 (18:47 +0300)]
Do not remove disks if --keep-disks and DT_EXT

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agorapi: Make use of request_body in Reboot/Remove
Dimitris Aragiorgis [Fri, 1 Nov 2013 14:55:11 +0000 (16:55 +0200)]
rapi: Make use of request_body in Reboot/Remove

Until now shutdown_timeout could only be passed in
ShutdownInstance() inside kwargs. It was included in
request's body. Based on that, extend RebootInstance() and
RemoveInstance() so that they can take extra arguments
(e.g. shutdown_timeout) and pass them eventually to the
corresponding opcode.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agorapi: Pass existing depends body arg to opcode
Dimitris Aragiorgis [Fri, 25 Oct 2013 14:42:52 +0000 (17:42 +0300)]
rapi: Pass existing depends body arg to opcode

Most rlib2 classes override default _GetDefaultData() method with
custom methods that parse request's body and query args and return a
(body, specific_static) tuple eventually passed to FillOpCode().
Job dependencies are defined in depends body argument that might get
"lost" because most of those methods return {} as body.  So in order
not to modify every custom method we update the returned body with
the depends argument of original request body for all rapi calls
inside OpcodeResource._GenericHandler(). So it's up to the client
to include `depends` argument including the job dependencies if desired.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoAllow instances to obtain externally reserved IPs
Dimitris Aragiorgis [Wed, 2 Oct 2013 19:05:18 +0000 (22:05 +0300)]
Allow instances to obtain externally reserved IPs

The administrator should be able to assign an externally reserved IP
to a Ganeti instance manually, if desired. Currently this is not
supported. External reservations should act as holes in the pool and
not just as IPs already used by someone outside of Ganeti.
Automatic allocation with ip=pool will continue to exclude those IPs
as happens now.

To allow such functionality the administrator needs to pass explicitly
the desired IP along with the ``--no-conflicts-check`` option, or else
an error will be produced as happens now.

The aforementioned require the following changes:

 - Make IsReserved() to look either in reservations or external ones.
 - Make Reserve() and Release() to use IsReserved() with external
   argument True or False.
 - Pass extra option to ReserveIp() to bypass checking of external reservations
 - Update man pages and design doc for this change.

Furthermore, a side effect of this patch is that it fixes the
following problem:
Currently, one could not mark an IP as external if it was already
reserved (i.e. belonged to an instance). The code would produce a warning
and fail silently.

Fix config_mock.py so that if network and ip is given then reserve it in
the pool.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoMark cluster's IPs as externally reserved
Dimitris Aragiorgis [Wed, 16 Oct 2013 09:50:38 +0000 (12:50 +0300)]
Mark cluster's IPs as externally reserved

Currently, upon network creation, nodes' and master's IPs
are reserved in the pool.

This leads to pool reservations ('X' in map) that cannot be changed
afterwards, although they may need to (e.g. in case of node
removal/modification). Also, these IPs are not actually handled by
Ganeti in the sense that they are not assigned to the cluster's VMs.

Thus, we should mark the as externally reserved and not just reserved.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoSimpleRetry on blockdev.Remove()
Dimitris Aragiorgis [Fri, 18 Oct 2013 12:25:54 +0000 (15:25 +0300)]
SimpleRetry on blockdev.Remove()

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoCheck if hotplug is supported in CheckPrereq
Dimitris Aragiorgis [Wed, 30 Oct 2013 09:28:48 +0000 (11:28 +0200)]
Check if hotplug is supported in CheckPrereq

Introduce new RPC hotplug_supported that invokes the corresponding
hypervisor's method which checks if hotplug is generally
supported. Call this RPC early in CheckPrereq() and abort if
hotplug is not supported. Currently only KVM hypervisor with
qemu versions > 1.0. Please not the this check is unaware of
target device and hotplug action. This latter check is still
done during hotplug_device() RPC.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agodrive_del after device_del in disk hot-remove
Dimitris Aragiorgis [Thu, 17 Oct 2013 12:17:54 +0000 (15:17 +0300)]
drive_del after device_del in disk hot-remove

This is needed so that qemu process really releases the
corresponding file descriptor and thus we can dmsetup/lvremove
the device without errors.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoSome fixes in _GenerateKVMBlockDevicesOptions()
Dimitris Aragiorgis [Thu, 10 Oct 2013 10:04:49 +0000 (13:04 +0300)]
Some fixes in _GenerateKVMBlockDevicesOptions()

* Add docstring.
* fix missed usecase of boot_disk=False if kernel_path is given.
* Use devlist arg in GenerateKVMBlockDeviceOptions()
  This is previously calculated in _ExecuteKVMRuntime()
  so there is no need to rerun the same command.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoUse blockdev_assemble rpc directly before hotplug
Dimitris Aragiorgis [Thu, 10 Oct 2013 14:44:53 +0000 (17:44 +0300)]
Use blockdev_assemble rpc directly before hotplug

AssebleInstanceDisks() if invoked with primary=True and disk=[disk]
creates wrong symbolic links!

Before blockdev_assemble we call SetDiskID() in order to fill up
physical_id of disk needed by bdev.Assemble and eventually by
constructor of each BlockDev.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoAdd finally: mosock.close() in _PassFds
Dimitris Aragiorgis [Thu, 10 Oct 2013 14:03:47 +0000 (17:03 +0300)]
Add finally: mosock.close() in _PassFds

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoAdd hotplug option in OpInstanceSetParams opcode
Dimitris Aragiorgis [Tue, 24 Sep 2013 18:02:48 +0000 (21:02 +0300)]
Add hotplug option in OpInstanceSetParams opcode

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoHotplug: cfgupgrade for deprecated fields
Dimitris Aragiorgis [Fri, 12 Jul 2013 12:34:07 +0000 (15:34 +0300)]
Hotplug: cfgupgrade for deprecated fields

Add cfgupgrade so that we remove any deprecated fields hotplug
implementation used in the past.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoHotplug: Update manpages and NEWS
Dimitris Aragiorgis [Fri, 26 Jul 2013 10:33:38 +0000 (13:33 +0300)]
Hotplug: Update manpages and NEWS

Add --hotplug entry in gnt-instance manpage.
Add NEWS entry for hotplug support.
In both cases mention that hotplug is only supported only the
the KVM Hypervisror and for versions >= 1.0.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoHotplug: client support
Dimitris Aragiorgis [Fri, 12 Jul 2013 12:33:48 +0000 (15:33 +0300)]
Hotplug: client support

Add --hotplug option. Only used in OpInstanceSetParams.
If this is omitted, modifications become effective after reboot.

Ask user confirmation in case NIC modify + hotplug because it will
be done via removing old NIC (and the corresponding tap) and adding
a new one in the same PCI slot.

Corresponding mods in haskell opcode definitions.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoHotplug: cmdlib support
Dimitris Aragiorgis [Sat, 25 May 2013 16:13:54 +0000 (19:13 +0300)]
Hotplug: cmdlib support

Hotpluging is done by functions invoked by ApplyContainerMods(). In
order hotpluging to take place the --hotplug option must be passed
otherwise the modifications will take place after reboot.

NIC hotplug supports add, remove and modify. The modify is done by removing
the existing NIC and adding a new one in the same pci slot.

Disk hotplug support add and remove.  Before hotpluging a Disk it
must be assembled. During LUInstanceSetParams() newly created disks
are not added to the instance so ExpandCheckDisks() in
AssembleInstanceDisks() will fail. So we make this check optional
only for this case.

In order to remove a disk (with blockdev_remove) it must be shutdown. So
after unpluging the disk ShutdownDiskInstanceDisks() must be invoked.

For both device types we use the generic RPC call_hotplug_device.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoHotplug: rpc support
Dimitris Aragiorgis [Thu, 9 Aug 2012 10:59:11 +0000 (13:59 +0300)]
Hotplug: rpc support

Introduce new RPC that eventually invoke hypervisor specific
hotplug functions. In order to be generic it has the following
arguments: device type, action, device, extra info, seq.
Device type can be NIC or DISK, action can be ADD, REMOVE,
device is the NIC or Disk object, extra info is used by Disk
hotplug to point the device path and seq is the device index
(from the master perspective)

If hypervisor does not support hotplug the opcode will fail.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoIntroduce hotplug methods (hypervisor inteface)
Dimitris Aragiorgis [Fri, 2 Aug 2013 20:00:15 +0000 (23:00 +0300)]
Introduce hotplug methods (hypervisor inteface)

4 new methods: HotAddDevice, HotDelDevice, HotModDevice, HotplugSupported
All these are the hypervisor interface with the backend.
In general they read current runtime info, do the actual hotplug
and update the runtime file.

NIC hot-add:
 - open a tap and get its file descriptor.
 - pass fd with SCM rights (using python-fdsend) via monitor socket
 - create netdev and device with id=kvm_devid and proper pci info

Disk hot-add:
 - create drive with id=kvm_devid
 - create device with id=kvm_devid and corresponding pci info

Use MonitorSocket in _PassTapFd in order to connect to monitor socket
and pass the tap's file descriptor using fdsend.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoExtract socket related code from QmpMonitor class
Dimitris Aragiorgis [Mon, 5 Aug 2013 10:22:17 +0000 (13:22 +0300)]
Extract socket related code from QmpMonitor class

Separate unix socket related code from QmpMonitor class and
make the latter extend the newly introduced one: MonitorSocket

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoHelper methods that check for hotplug support
Dimitris Aragiorgis [Fri, 2 Aug 2013 19:54:46 +0000 (22:54 +0300)]
Helper methods that check for hotplug support

Hotplug is currently *not* supported for:

 - KVM < 1.0
 - existing devices in the cluster
 - python-fdsend module is not installed (NIC hotplug)
 - chroot (Disk hotplug)
 - security mode other than None (Disk hotplug)

For the above reasons raise HotplugError exception and
let masterd handle it.

TODO: modify CallHotplugCommand() so that it parses
monitor output and reports whether the command
succeeded or not.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoUse -device with pci info if possible
Dimitris Aragiorgis [Fri, 2 Aug 2013 19:50:00 +0000 (22:50 +0300)]
Use -device with pci info if possible

Extend kvm_cmd with -device option for the case of paravirual
Disks and NICs.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoHepler methods for PCI slots and device ids
Dimitris Aragiorgis [Mon, 5 Aug 2013 15:26:48 +0000 (18:26 +0300)]
Hepler methods for PCI slots and device ids

Device naming:
QEMU monitor expects devices to be uniquely named. Device ids derive
from the following function:
kvm_devid = <device_type>-<part of uuid>-pci-<pci_slot>
Device ids must be reproduce-able when we want to remove them.
For that reason we store the pci slot inside the runtime file and
in case we want to remove a device we obtain its pci slot by
parsing the corresponding runtime enrty and matching the device
by its uuid.

Finding the PCI slot:
For newly added devices Hypervisor parses existing PCI allocations
(via _GetFreePCISlot() and eventually ``info pci`` monitor
command) and decides the PCI slot to plug in the device. During
instance startup hypervisor invokes _UpdatePCISlots() for every
device of the instance.  Initial PCI reservations derive from KVM
default setup, that allocates 4 slots for devices other than disks
and NICs.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoPrepare block_devices runtime entry
Dimitris Aragiorgis [Mon, 5 Aug 2013 15:23:23 +0000 (18:23 +0300)]
Prepare block_devices runtime entry

With this patch we add another entry in runtime files along with
kvm_cmd, kvm_nics, and hvparams. block_devices that used to be
encapsulated inside kvm_cmd, live now separately just like nics do
but in tupples of (L{objects.Disk}, dev_path).

Introduce also _GetExistingDeviceInfo() helper function to search
for runtime entries. This is going to be useful later in hotplug
methods.

Define new exception: HotplugError.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoPrepare kvm options to support -device for disks
Dimitris Aragiorgis [Fri, 2 Aug 2013 16:44:29 +0000 (19:44 +0300)]
Prepare kvm options to support -device for disks

Newer kvm version support -device driver,... option where available
drivers can be found by running kvm -device ? command. Currently
ganeti uses `if` property of driver to define the disk type to use
which is also passed as hvparam. This patch prepares the use of
-device option only for paravirtual disks. To support other drivers
as well we must create a mapping between the values passed now as
disk_type hvparam and existing drivers. Note that if -device is used
`if` property of `drive` option should be `none`.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoIntroduce _GenerateKVMBlockDevicesOptions()
Dimitris Aragiorgis [Fri, 2 Aug 2013 16:37:02 +0000 (19:37 +0300)]
Introduce _GenerateKVMBlockDevicesOptions()

Simply move logic that generates block device related
options out of _GenerateKVMRuntime().

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoAdd hotplug related constants
Dimitris Aragiorgis [Sat, 21 Sep 2013 08:32:53 +0000 (11:32 +0300)]
Add hotplug related constants

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoHotplug: objects and constants additions
Dimitris Aragiorgis [Thu, 9 Aug 2012 10:54:18 +0000 (13:54 +0300)]
Hotplug: objects and constants additions

Add pci slot in NIC/Disk objects. This slot will be used only
by hypervisor code. Currently only KVM will use it and store it
temporarily in runtime files.
Add HOTPLUG_* constants to define device types an hotplug actions.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoVersion bump for 2.8.2 v2.8.2
Michele Tartara [Wed, 6 Nov 2013 12:26:24 +0000 (12:26 +0000)]
Version bump for 2.8.2

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoUpdate NEWS file for 2.8.2 release
Michele Tartara [Wed, 6 Nov 2013 12:25:16 +0000 (12:25 +0000)]
Update NEWS file for 2.8.2 release

Add a section in the file for the new upcoming release.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoDRBD: ensure peers are UpToDate for dual-primary
Apollon Oikonomopoulos [Tue, 5 Nov 2013 14:30:45 +0000 (16:30 +0200)]
DRBD: ensure peers are UpToDate for dual-primary

DrbdAttachNet supports both, normal primary/secondary node operation, and
(during live migration) dual-primary operation. When resources are newly
attached, we poll until we find all of them in connected or syncing operation.

Although aggressive, this is enough for primary/secondary operation, because
the primary/secondary role is not changed from within DrbdAttachNet. However,
in the dual-primary ("multimaster") case, both peers are subsequently upgraded
to the primary role.  If - for unspecified reasons - both disks are not
UpToDate, then a resync may be triggered after both peers have switched to
primary, causing the resource to disconnect:

  kernel: [1465514.164009] block drbd2: I shall become SyncTarget, but I am
    primary!
  kernel: [1465514.171562] block drbd2: ASSERT( os.conn == C_WF_REPORT_PARAMS )
    in /build/linux-rrsxby/linux-3.2.51/drivers/block/drbd/drbd_receiver.c:3245

This seems to be extremely racey and is possibly triggered by some underlying
network issues (e.g. high latency), but it has been observed in the wild. By
logging the DRBD resource state in the old secondary, we managed to see a
resource getting promoted to primary while it was:

  WFSyncUUID Secondary/Primary Outdated/UpToDate

We fix this by explicitly waiting for "Connected" cstate and
"UpToDate/UpToDate" disks, as advised in [1]:

  "For this purpose and scenario,
   you only want to promote once you are Connected UpToDate/UpToDate."

[1] http://lists.linbit.com/pipermail/drbd-user/2013-July/020173.html

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoImprove error message for replace-disks
Michele Tartara [Mon, 4 Nov 2013 15:20:07 +0000 (15:20 +0000)]
Improve error message for replace-disks

In some conditions, replace-disks will fail if the disks are not properly
activated. Improve the error message suggesting to run activate-disks before
executing replace-disks.

Fixes Issue 606.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd all dependencies for confd as test dependencies
Klaus Aehlig [Wed, 30 Oct 2013 10:13:48 +0000 (11:13 +0100)]
Add all dependencies for confd as test dependencies

Since our tests pull in confd as a dependency, all build dependencies
for confd are also necessary to run the tests.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdd snap-server to the test-relevenat packages
Klaus Aehlig [Tue, 29 Oct 2013 15:09:14 +0000 (16:09 +0100)]
Add snap-server to the test-relevenat packages

While snap-server is only needed for the optional monitoring daemon,
some tests, notably those testing these optional features, still depend
on it. So, if snap-server is missing, the Haskell tests should not be
run, as they cannot even be build.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoPlacate warnings on ganeti.outils_unittest.py
Santi Raffa [Wed, 23 Oct 2013 14:20:24 +0000 (16:20 +0200)]
Placate warnings on ganeti.outils_unittest.py

Change ovf.py from using 'if foo:' to 'if foo is not None:' checks as
suggested by the FutureWarnings the OVF library raises otherwise.
This fixes issue 557.

Signed-off-by: Santi Raffa <rsanti@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>

10 years agoVersion bump for 2.8.1 v2.8.1
Michele Tartara [Thu, 17 Oct 2013 10:36:44 +0000 (12:36 +0200)]
Version bump for 2.8.1

Also, update the NEWS file accordingly.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoVerify that ConfD is running after master-failover
Helga Velroyen [Wed, 16 Oct 2013 11:11:18 +0000 (13:11 +0200)]
Verify that ConfD is running after master-failover

This patch adds additional 'gnt-node list' commands to
the testing of 'gnt-cluster master-failover' in order to
test if ConfD (or LuxiD) is still running after a
master-failover.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agodaemon-util: handle luxid in {start,stop}_master()
Apollon Oikonomopoulos [Wed, 16 Oct 2013 09:17:23 +0000 (12:17 +0300)]
daemon-util: handle luxid in {start,stop}_master()

Luxid was not handled in start_master() and stop_master() at all. As a result,
during a master-failover, luxid would be left running on the old master and
would not start on the new master, leaving the cluster without management until
luxid was manually started.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix typo in storage.FileStorage docstring
Santi Raffa [Tue, 15 Oct 2013 08:13:28 +0000 (10:13 +0200)]
Fix typo in storage.FileStorage docstring

Signed-off-by: Santi Raffa <rsanti@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>

10 years agoFix path for serial file
Klaus Aehlig [Wed, 16 Oct 2013 07:32:02 +0000 (09:32 +0200)]
Fix path for serial file

It is actually located inside the queue directory.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoLet ganeti run as root
Dimitris Aragiorgis [Tue, 15 Oct 2013 16:16:53 +0000 (19:16 +0300)]
Let ganeti run as root

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoRename ganeti.* debian files to snf-ganeti.*
Dimitris Aragiorgis [Tue, 15 Oct 2013 15:44:57 +0000 (18:44 +0300)]
Rename ganeti.* debian files to snf-ganeti.*

Change genscript.py to search for those files

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoAdd vcs-version
Dimitris Aragiorgis [Tue, 15 Oct 2013 14:57:09 +0000 (17:57 +0300)]
Add vcs-version

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoautogen.sh before configure
Dimitris Aragiorgis [Tue, 15 Oct 2013 14:52:01 +0000 (17:52 +0300)]
autogen.sh before configure

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoUse iproute instead of iproute2
Dimitris Aragiorgis [Tue, 15 Oct 2013 14:46:02 +0000 (17:46 +0300)]
Use iproute instead of iproute2

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoRemove debian patches
Dimitris Aragiorgis [Tue, 15 Oct 2013 14:21:19 +0000 (17:21 +0300)]
Remove debian patches

TODO: find out why gbp fails. It says something about "guilt update"

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agosnf-ganeti provides ganeti2
Dimitris Aragiorgis [Tue, 15 Oct 2013 13:57:49 +0000 (16:57 +0300)]
snf-ganeti provides ganeti2

and conflicts too.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoAdd --with-extstorage-search-path
Dimitris Aragiorgis [Mon, 16 Jul 2012 17:45:50 +0000 (20:45 +0300)]
Add --with-extstorage-search-path

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoChanges for GRNET's custom package
Dimitris Aragiorgis [Tue, 15 Oct 2013 13:48:41 +0000 (16:48 +0300)]
Changes for GRNET's custom package

Rename package to snf-ganeti
Add python-fdsend dependency needed by hotplug.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoAdd official debian tree
Dimitris Aragiorgis [Tue, 15 Oct 2013 13:46:43 +0000 (16:46 +0300)]
Add official debian tree

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoImprove harep documentation
Michele Tartara [Thu, 10 Oct 2013 14:03:44 +0000 (14:03 +0000)]
Improve harep documentation

Add a more complete description of how the tool works.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix typo in walkthrough documentation
Jose A. Lopes [Tue, 8 Oct 2013 11:26:47 +0000 (13:26 +0200)]
Fix typo in walkthrough documentation

Fix typo in walkthrough documentation, where 'instance3' should read
'instance1' in order to be consistent with the output below in the
example.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoDon't attemp ipv6 ssh in case of ipv4 cluster
Costas Drogos [Thu, 3 Oct 2013 09:37:14 +0000 (12:37 +0300)]
Don't attemp ipv6 ssh in case of ipv4 cluster

In case of a cluster with primary-ip-version=4, there is no need
for cluster to try ipv6 ssh connections which may timeout.
So append '-4' on ssh if cluster is ipv4-only

Signed-off-by: Costas Drogos <costas.drogos@gmail.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix outdated documentation for users-setup
Michele Tartara [Mon, 7 Oct 2013 07:51:30 +0000 (07:51 +0000)]
Fix outdated documentation for users-setup

The --yes-do-it parameter was not properly documented yet. Add it to the
administration guide.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix wrong release date in the NEWS file v2.8.0
Michele Tartara [Fri, 27 Sep 2013 13:02:14 +0000 (15:02 +0200)]
Fix wrong release date in the NEWS file

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoVersion bump for 2.8.0
Michele Tartara [Fri, 27 Sep 2013 12:32:58 +0000 (14:32 +0200)]
Version bump for 2.8.0

Also, update the NEWS file accordingly.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd daemon split design doc
Michele Tartara [Tue, 6 Aug 2013 15:19:49 +0000 (15:19 +0000)]
Add daemon split design doc

This describes the future planned structure of Ganeti daemons.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoMerge branch 'stable-2.7' into stable-2.8
Michele Tartara [Thu, 26 Sep 2013 11:32:57 +0000 (13:32 +0200)]
Merge branch 'stable-2.7' into stable-2.8

Conflicts are trivially solved.

* stable-2.7
  Version bump for 2.7.2 (updated NEWS file)

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

Conflicts:
NEWS
configure.ac

10 years agoVersion bump for 2.7.2 v2.7.2
Michele Tartara [Thu, 26 Sep 2013 07:53:10 +0000 (09:53 +0200)]
Version bump for 2.7.2

Change the version number and the NEWS file for the 2.7.2 bugfix release.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd additional tests for utils.Retry
Klaus Aehlig [Fri, 20 Sep 2013 11:45:47 +0000 (13:45 +0200)]
Add additional tests for utils.Retry

Also have some tests where the time the various components
(inspecting the time function, calling the function, etc) have
a non-trivial time. Also, have two tests demonstrating that
the number of retries actually depends on the amount of time
the function takes to complete.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoMake retry tests independent of actual time
Klaus Aehlig [Thu, 19 Sep 2013 15:05:29 +0000 (17:05 +0200)]
Make retry tests independent of actual time

Even in the tests, real time is used. While, generally, the assumptions
about execution time are pretty safe, in some rare circumstances, e.g.,
on machines with extremely heavy load they do not hold true, thus rendering
the tests flaky. Fix this, by mocking time.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoFix corner-case in handling of remaining retry time
Klaus Aehlig [Thu, 19 Sep 2013 16:12:21 +0000 (18:12 +0200)]
Fix corner-case in handling of remaining retry time

Consider a remaining time of 0 as already timed out. Otherwise,
there is no guarantee that calling utils.Retry with timeout 0
will call the function precisely once; it might run in time
shorter than the resolution of timer.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoPerform proper cleanup on termination of Haskell daemons
Michele Tartara [Wed, 18 Sep 2013 13:38:18 +0000 (15:38 +0200)]
Perform proper cleanup on termination of Haskell daemons

Haskell deamons did not perform proper cleanup at termination. There was no code
for removing the pid file, and the code in LuxiD for removing the unix socket
file was not working, because it is implemented with a "finally" statement,
which is executed only when the main loop of the daemon is exited (either
normally, or through an exception), but not when it is terminated by a SIGTERM.

This commit adds a proper handler for SIGTERM, which transforms it into a
successful termination exception. This allows both the newly added cleanup code
for pid files and the unmodified cleanup code for unix sockets to be executed.

Fixes Issue 581 and 582.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoVersion bump for 2.8 rc3 v2.8.0rc3
Michele Tartara [Tue, 17 Sep 2013 08:43:02 +0000 (10:43 +0200)]
Version bump for 2.8 rc3

Also, add to the NEWS file a couple of items that were still missing.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoMerge branch 'stable-2.7' into stable-2.8
Klaus Aehlig [Mon, 16 Sep 2013 11:52:45 +0000 (13:52 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7
  Fix incorrect manpage reference to htools

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix incorrect manpage reference to htools
Martin Zobel-Helas [Mon, 16 Sep 2013 11:42:46 +0000 (13:42 +0200)]
Fix incorrect manpage reference to htools

the manpages for hcheck, hinfo and hroller have an incorrect reference
to htools(7) which does not exist. This patch links them to htools(1).

This bug also fixes Debian BTS#721824 (http://bugs.debian.org/721824)

Signed-off-by: Martin Zobel-Helas <zobel@debian.org>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd a default to file-driver when unspecified over RAPI
Michele Tartara [Mon, 16 Sep 2013 11:06:31 +0000 (11:06 +0000)]
Add a default to file-driver when unspecified over RAPI

The file-driver value, used by file-based instances, had a default value when
an instance was being created over the CLI, but not when the instance was
created through the RAPI.

This patch introduces a default value for the remote API and, while doing so,
also centralizes in a single place the definition of such a value, for both the
interfaces, in order to remove the possibility for them to be out of sync.

Fixes Issue 571.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRemove typo from RAPI documentation
Michele Tartara [Fri, 13 Sep 2013 09:27:51 +0000 (09:27 +0000)]
Remove typo from RAPI documentation

"be used instead." was repeated twice.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoDescribe the files in doc/users in NEWS
Klaus Aehlig [Thu, 12 Sep 2013 09:38:24 +0000 (11:38 +0200)]
Describe the files in doc/users in NEWS

While only a small feature, the files in doc/users can influence
the way ganeti is packaged. Hence it should be mentioned in the
news file.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoUpdate the upgrade procedure
Klaus Aehlig [Thu, 12 Sep 2013 09:08:34 +0000 (11:08 +0200)]
Update the upgrade procedure

Now that users-setup asks for confirmation, explain in the
procedure how asking for this confirmation can be skipped.
This skipping is particularly important for users following
the recommendation of using the distributed shell (dsh).

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMake tools/users-setup explain its actions first
Klaus Aehlig [Wed, 11 Sep 2013 09:00:15 +0000 (11:00 +0200)]
Make tools/users-setup explain its actions first

Before doing any changes, make tools/users-setup explain its
actions first, and ask the user for confirmation. If the first
argument is --yes-do-it, this step will be skipped.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoGenerate tools/users-setup from descriptions
Klaus Aehlig [Wed, 11 Sep 2013 08:27:23 +0000 (10:27 +0200)]
Generate tools/users-setup from descriptions

Now that we have a machine readable description of the users
to be added to the system, use it to generate the tools/users-setup
script, so that we again have only one authoritative source of
the user and group requirements. This also has the advantage of
of avoiding duplicate additions and attemps add a user root.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoProvide ganeti user and group data in easy-to-parse form
Klaus Aehlig [Tue, 10 Sep 2013 16:00:23 +0000 (18:00 +0200)]
Provide ganeti user and group data in easy-to-parse form

Upon build time, also generate, in the directory doc/users, files
containing the groups, the users with their primary group, and the
additional groupmemberships to be added. In this way, packages can use
their own way of adding users to the system, instead of telling the
adiministrator to run tools/users-setup.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoRemove dsahostkeypub during config downgrade
Apollon Oikonomopoulos [Sun, 1 Sep 2013 20:37:08 +0000 (23:37 +0300)]
Remove dsahostkeypub during config downgrade

Remove the newly-added DSA host public key field from the configuration file
when downgrading to 2.7, if present. Otherwise masterd will refuse to start.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMark the DSA host pubkey as optional
Apollon Oikonomopoulos [Sun, 1 Sep 2013 20:36:29 +0000 (23:36 +0300)]
Mark the DSA host pubkey as optional

Commit a9542a4 introduced support for DSA SSH keys. However, the dsahostkeypub
field added to the config is not marked as optional in the Haskell components.
As a result, luxid thinks the config file is corrupt and refuses to start. We
fix this by marking the dsahostkeypub as an optionalField.

This fixes issue 560.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix documentation for gnt-node evacuate -p option
Leon Handreke [Wed, 28 Aug 2013 15:10:49 +0000 (16:10 +0100)]
Fix documentation for gnt-node evacuate -p option

Update the documentation to remove the claim that the --primary-only
option results in data copies while in fact it only fails over/migrates
the all primary instances.

Signed-off-by: Leon Handreke <lhandreke@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoNEWS update and version bump for 2.8 rc2 v2.8.0rc2
Michele Tartara [Tue, 27 Aug 2013 07:59:14 +0000 (09:59 +0200)]
NEWS update and version bump for 2.8 rc2

Latest modifications and fixes added to the NEWS file.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoAdd unit test for GetLinuxNodeInfo
Michele Tartara [Thu, 22 Aug 2013 08:53:07 +0000 (08:53 +0000)]
Add unit test for GetLinuxNodeInfo

The function was not unit tested previously.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoPrepare GetLinuxNodeInfo for testing
Michele Tartara [Thu, 22 Aug 2013 08:31:45 +0000 (10:31 +0200)]
Prepare GetLinuxNodeInfo for testing

The names of the input files are not hardcoded anymore, but they are now default
parameters.

No changes for the callers, but it's now possible to test the function more
easily.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoMake the DRBD collector more failure-resilient
Michele Tartara [Wed, 21 Aug 2013 14:17:38 +0000 (14:17 +0000)]
Make the DRBD collector more failure-resilient

If information about instances is not available, just log the error and
continue without it.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd function to unwrap Results logging failures
Michele Tartara [Wed, 21 Aug 2013 14:15:30 +0000 (14:15 +0000)]
Add function to unwrap Results logging failures

Add logWarningIfBad, a utility function similar to exitIfBad, that logs a
warning and returns a default value instead of just crashing the program if
the unpacked value is Bad.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>