Skip to content

Conversation

lindig
Copy link
Contributor

@lindig lindig commented Sep 24, 2018

This PR contains a series of backports from the master branch. All commits were cherry-picked and did not require manual changes. Below are the key commits:

  • f446487 2018-04-12 CA-287865: Forwarded task calling Message_forwarding.xxx result.. Rob Hoes
  • 7c31dd1 2018-04-13 CA-287863: xe vm-shutdown complete the task too early Yang Qian
  • 3f9e67c 2018-04-13 CA-287863: Reorgnize the code Yang Qian
  • 7c35d06 2018-04-04 CA-286364: When creating guest_metrics, ensure all fields refle.. ..cello Seri
  • 10b5068 2017-05-23 CA-223802 [xso-672] When existing network is deactivated and ne.. Rob Hoes
  • 06e5380 2018-06-12 CP-28117: restart HA VMs in parallel when recovering from host .. Jon Ludlam
  • 5f62052 2018-06-12 CP-28117: introduce helper module for running tasks in parallel Jon Ludlam
  • 3591480 2018-06-12 CP-28117: refactor by_order Jon Ludlam
  • 492ebeb 2018-06-12 CP-28117: log backtrace from restart_auto_run_vms Jon Ludlam
  • 201d131 2018-07-13 CA-293858: Further prevention of logrotate running on old parti.. Jon Ludlam

@edwintorok
Copy link
Contributor

My commits look correct, I think we'd have to backport this too if we haven't done it already: xapi-project/xen-api-libs-transitional#41

@lindig
Copy link
Contributor Author

lindig commented Sep 24, 2018

The commits for xen-api-libs-transitional are on the 1.0-lcm branch and already.

$ git tag --contains 1d055c0
v1.0.2
v1.0.3


ddb89a8 2018-09-14 CP-29015: Set correct ciphers for stunnel client                  Wei Xie     
1d055c0 2018-05-16 HFX-2158 CA-285840: Make sure stunnel doesn't hang talking to d.. ..ian Lindig
8dcf8b6 2017-03-20 Prepare to release v1.0.1                                         Jon Ludlam  
ca7f951 2017-03-20 Add unix dependency to uuid                                       Jon Ludlam  
31eb98d 2017-03-10 buf_io: add function is_buffer_empty                              ..han Davies

YarsinCitrix and others added 10 commits September 24, 2018 14:59
… current task being early marked completed

This issue is raised found due to on forwarded task, some call further to be forwarded
will still be done in the same task so resulting the current task marked as completed
when the forwarding call completes (actually should be some sub task). In some situation,
this will cause further issue like task being destroyed by GC.

The original issue is from pool.hello. However when making code change, similar
issue is spotted in xapi_host.ml. So similar changes is done for xapi_host.ml.

Signed-off-by: YarsinCitrix <yarsin.he@citrix.com>
Move `exec` into `exec_with_context` to simplify the code.

Signed-off-by: Yang Qian <yang.qian@citrix.com>
When master forward a task to slave, slave will mark the task as completed once
finish processing it, however when master finishing the forwarding, it will also
mark the task as completed. Furthermore, when slave finished the task, that does
not mean the task is done, there may be some stuff that master has to handle, so
we have to ensure the task only complete once the master finish its work.

For the task forwarded from client, which called with
`exec_with_forwarded_task`, we also have to complete it once it finished.

Signed-off-by: Yang Qian <yang.qian@citrix.com>
…current state

In CA-286364, a reboot happened on a VM that had PV tools installed. This
triggered xapi's updates-from-xenopsd to look at the new state. This was slow
for other reasons and by the time we were looking at the events the VM had
reloaded its PV drivers.

When we notice a VM has a different start time we delete and recreate the guest
metrics. This object was, prior to this change, created with `PV_drivers_detected`
taking the default value of `false`.

We then took a look at the value of 'PV_drivers_detected' in the current state
of the VM and noticed that it hadn't changed since we last looked at it (before
the VM rebooted) - so we didn't set the field in the database.

The change in this CS ensures we always create the guest_metrics with the current
state of the VM, which we were already doing for all other fields in
`VM_guest_metrics`.

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
…etwork is added, 'Networking' tab of the VM shows incorrect information.

Signed-off-by: minglumlu <ming.lu@citrix.com>
This makes debugging easier, otherwise you can't see where the exception
is raised from.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
HA VM restarts need to happen in the order defined by the HA policy and
handle failures.  The initial implementation used code specialized to
do that by preparing a record with VMs and tasks, sorting them, retrying
them, but it soon became unreadable and each slight modification required
large restructuring in the code.

The code is simpler and more readable if we introduce a general purpose
mechanism for performing actions after a task has finished, and for
automatically grouping actions by an order number and launching them
in parallel. The abstraction used is a monad, however the knowledge of
monads is kept minimal by having the naming and documentation in the
code refer to tasks and actions, rather than abstract monad concepts.
The code tries to be careful about exceptions, and wraps them in a
Result type.

This is the just the helper module implementation.

Note for backporting:
 older versions will not have a result module, you need to define:
 ```
 module Result = struct type 'a result = Ok of 'a | Error of 'a end
 let (|>) x f = f x
 ```

 `Xapi_stdext_std` is just `Stdext`
 'let open ... in' probably needs to be replaced with an open at toplevel

To make backporting easier GADTs are not used here, and changes are contained in a single file.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
…lure

HA VM restarts need to happen in the order defined by the HA policy.
We can restart all VMs with start order 0 in parallel, wait until all of
them are started (or failed), then start all with order 1, etc.
We also need to support retrying after failures.

Best effort VMs are now also sorted and restarted based on start order,
and in parallel.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
…n scheme

There's a firstboot script that attempts to prevent the new logrotate script
running when you've got the old-style partition layout. It does this by moving
the cron file aside. Unfortunately the cron file belongs to the xapi RPM and
hence installing any newer xapi-core RPM puts the file back in place.

This is a quick-fix solution that applies the same logic that the firstboot
script uses to detect old-style partitioning and bails out if it sees it.

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Copy link
Member

@robhoes robhoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked the other ones, and it looks fine.

@robhoes robhoes merged commit 2f466bf into xapi-project:1.14-lcm Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants