forked from xapi-project/xen-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'xapi-project:master' into master
- Loading branch information
Showing
362 changed files
with
11,186 additions
and
5,431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ on: | |
jobs: | ||
ocaml-format: | ||
name: Ocaml files | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
|
@@ -22,7 +22,10 @@ jobs: | |
- name: Load environment file | ||
id: dotenv | ||
uses: falti/[email protected] | ||
uses: falti/[email protected] | ||
|
||
- name: Update Ubuntu repositories | ||
run: sudo apt-get update | ||
|
||
- name: Use ocaml | ||
uses: ocaml/setup-ocaml@v2 | ||
|
@@ -31,11 +34,10 @@ jobs: | |
opam-repositories: | | ||
xs-opam: ${{ steps.dotenv.outputs.repository }} | ||
dune-cache: true | ||
opam-pin: false | ||
|
||
- name: Install ocamlformat | ||
run: | | ||
opam update | ||
opam install ocamlformat | ||
run: opam install ocamlformat | ||
|
||
- name: Check whether `make format` was run | ||
run: opam exec -- dune build @fmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Generate and upload Hugo docs | ||
|
||
on: | ||
push: | ||
branches: master | ||
|
||
jobs: | ||
ocaml: | ||
name: Docs | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: '0.119.0' | ||
|
||
- name: Build | ||
run: | | ||
cd doc | ||
hugo --minify | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
deploy_key: ${{ secrets.ACTIONS_DOCS_DEPLOY_KEY }} | ||
publish_dir: ./doc/public | ||
user_name: 'Github action on xapi-project/xen-api' | ||
user_email: 'github-actions-xapi-project-xen-api[bot]@users.noreply.github.com' | ||
external_repository: xapi-project/xapi-project.github.io | ||
publish_branch: master | ||
destination_dir: new-docs # temporary staging branch | ||
allow_empty_commit: false | ||
enable_jekyll: true # do not create .nojekyll file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ on: | |
jobs: | ||
python-test: | ||
name: Python tests | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -36,67 +36,33 @@ jobs: | |
name: Ocaml tests | ||
runs-on: ubuntu-20.04 | ||
env: | ||
package: 'xapi-cli-protocol xapi-client xapi-consts xapi-datamodel xapi-types xapi | ||
xe xen-api-sdk xen-api-client xen-api-client-lwt xen-api-client-async | ||
xapi-rrdd xapi-rrdd-plugin xapi-rrd-transport xapi-rrd-transport-utils | ||
rrd-transport rrdd-plugin rrdd-plugins rrddump gzip http-lib pciutil | ||
safe-resources sexpr stunnel uuid xapi-compression xml-light2 zstd | ||
vhd-tool xapi-networkd xapi-squeezed xapi-xenopsd xapi-xenopsd-cli | ||
xapi-xenopsd-simulator xapi-xenopsd-xc message-switch | ||
message-switch-async message-switch-cli message-switch-core | ||
message-switch-lwt message-switch-unix xapi-idl forkexec xapi-forkexecd | ||
xapi-storage xapi-storage-script xapi-storage-cli wsproxy xapi-nbd | ||
varstored-guard xapi-log xapi-open-uri vhd-format vhd-format-lwt | ||
xapi-tracing xapi-expiry-alerts ezxenstore' | ||
XAPI_VERSION: "v0.0.0-${{ github.sha }}" | ||
XAPI_VERSION: "v0.0.0" | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# The checkout action performs a shallow, this triggers dune to set the | ||
# version to <hash>-dirty. Work around this dune behaviour and tag the | ||
# commit so a proper version is always picked up | ||
- name: Tag current commit | ||
run: | | ||
git config user.name "Dune workaround" | ||
git config user.email "<>" | ||
git tag -am "workaround for dune" "$XAPI_VERSION" | ||
- name: Pull configuration from xs-opam | ||
run: | | ||
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/master/tools/xs-opam-ci.env | cut -f2 -d " " > .env | ||
- name: Load environment file | ||
id: dotenv | ||
uses: falti/[email protected].2 | ||
uses: falti/[email protected].4 | ||
|
||
- name: Retrieve date for cache key | ||
id: cache-key | ||
run: echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Restore opam cache | ||
id: opam-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: "~/.opam" | ||
# invalidate cache daily, gets built daily using a scheduled job | ||
key: ${{ steps.cache-key.outputs.date }} | ||
- name: Update Ubuntu repositories | ||
run: sudo apt-get update | ||
|
||
- name: Use ocaml | ||
uses: avsm/setup-ocaml@v1 | ||
uses: ocaml/setup-ocaml@v2 | ||
with: | ||
ocaml-version: ${{ steps.dotenv.outputs.ocaml_version_full }} | ||
opam-repository: ${{ steps.dotenv.outputs.repository }} | ||
ocaml-compiler: ${{ steps.dotenv.outputs.ocaml_version_full }} | ||
opam-repositories: | | ||
xs-opam: ${{ steps.dotenv.outputs.repository }} | ||
dune-cache: true | ||
|
||
- name: Install dependencies | ||
run: | | ||
opam update | ||
opam pin add . --no-action | ||
opam depext -u ${{ env.package }} | ||
opam upgrade | ||
opam install ${{ env.package }} --deps-only --with-test -v | ||
run: opam install . --deps-only --with-test -v | ||
|
||
- name: Configure | ||
run: opam exec -- ./configure --xapi_version="$XAPI_VERSION" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Quick start guide: | ||
|
||
- Install Hugo; follow the guidance on https://gohugo.io/getting-started/installing. | ||
You'll need Go as well: see https://go.dev/ | ||
- Run a local server: `hugo server` | ||
- Open a browser at http://127.0.0.1:1313/ | ||
- Add some content. | ||
- Documents are written in Markdown. | ||
- Please wrap lines in paragraphs to make review and diffs easier to read. | ||
- The menu hierarchy comes mostly from the directory structure in `content/`. | ||
- A file called `_index.md` is needed in a directory to define a new level in the menu. Add a title to the frontmatter. | ||
- For a page that has images or other stuff included, it is best to create a new directory. Put the contents in a `index.md` file (no `_`) and the related files next to it. See https://gohugo.io/content-management/organization/ for more information. | ||
- Look at https://mcshelby.github.io/hugo-theme-relearn/ for more information about what the Relearn theme offers, including some handy "shortcodes". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
+++ | ||
title = '{{ replace .File.ContentBaseName "-" " " | title }}' | ||
date = {{ .Date }} | ||
draft = true | ||
+++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
+++ | ||
title = "XAPI Toolstack Developer Guide" | ||
archetype = "home" | ||
+++ | ||
|
||
The **XAPI Toolstack**: | ||
|
||
- Forms the control plane of both [XenServer](http://xenserver.com) as well as | ||
[xcp-ng](http://xcp-ng.org), | ||
- manages clusters of Xen hosts with shared storage and networking, | ||
- has a full-featured [API](http://xapi-project-github.io/xen-api), used by clients such as | ||
[XenCenter](https://github.com/xenserver/xenadmin) and [Xen Orchestra](https://xen-orchestra.com). | ||
|
||
The XAPI Toolstack is an open-source project developed by the [xapi | ||
project](http://www.xenproject.org/developers/teams/xapi.html), a sub-project of the Linux | ||
Foundation Xen Project. | ||
|
||
The source code is available on [Github under the xapi-project](https://github.com/xapi-project/). the main repository is [xen-api](https://github.com/xapi-project/xen-api). | ||
|
||
This developer guide documents the internals of the Toolstack to help developers understand the code, fix bugs and add new features. It is a work-in-progress, with new documents added when ready and updated whenever needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: The XAPI Toolstack | ||
menuTitle: The Toolstack | ||
weight: 10 | ||
--- | ||
|
||
{{% children depth="2" %}} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
+++ | ||
title = "Disaster Recovery" | ||
+++ | ||
|
||
The [HA](../HA/HA.html) feature will restart VMs after hosts have failed, but what | ||
happens if a whole site (e.g. datacenter) is lost? A disaster recovery | ||
configuration is shown in the following diagram: | ||
|
||
![Disaster recovery maintaining a secondary site](dr.png) | ||
|
||
We rely on the storage array's built-in mirroring to replicate (synchronously | ||
or asynchronously: the admin's choice) between the primary and the secondary | ||
site. When DR is enabled the VM disk data and VM metadata are written to the | ||
storage server and mirrored. The secondary site contains the other side | ||
of the data mirror and a set of hosts, which may be powered off. | ||
|
||
In normal operation, the DR feature allows a "dry-run" recovery where a host | ||
on the secondary site checks that it can indeed see all the VM disk data | ||
and metadata. This should be done regularly, so that admins are familiar with | ||
the process. | ||
|
||
After a disaster, the admin breaks the mirror on the secondary site and triggers | ||
a remote power-on of the offline hosts (either using an out-of-band tool or | ||
the built-in host power-on feature of xapi). The pool master on the secondary | ||
site can connect to the storage and extract all the VM metadata. Finally the | ||
VMs can all be restarted. | ||
|
||
When the primary site is fully recovered, the mirror can be re-synchronised | ||
and the VMs can be moved back. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
participant slave1 | ||
Note over master: Host.enable_ha\nchoose an SR\nfind or create VDIs\nattach VDIs\nwrite xhad.conf\nha_set_pool_state init | ||
master->slave1: Host.preconfigure_ha | ||
Note over slave1: attach VDIs\nwrite xhad.conf\n | ||
master->slave2: Host.preconfigure_ha | ||
Note over slave2: attach VDIs\nwrite xhad.conf\n | ||
master->slave1: Host.ha_join_liveset | ||
master->slave2: Host.ha_join_liveset | ||
Note over master: ha_propose_master | ||
slave1-->master: wait for master | ||
slave2-->master: wait for master |
Oops, something went wrong.