diff --git a/@vates/async-each/README.md b/@vates/async-each/README.md index 93cdbe8d3d..09ccef1da1 100644 --- a/@vates/async-each/README.md +++ b/@vates/async-each/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/async-each): -``` -> npm install --save @vates/async-each +```sh +npm install --save @vates/async-each ``` ## Usage diff --git a/@vates/cached-dns.lookup/README.md b/@vates/cached-dns.lookup/README.md index fa3244bc39..3865cf9300 100644 --- a/@vates/cached-dns.lookup/README.md +++ b/@vates/cached-dns.lookup/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/cached-dns.lookup): -``` -> npm install --save @vates/cached-dns.lookup +```sh +npm install --save @vates/cached-dns.lookup ``` ## Usage diff --git a/@vates/coalesce-calls/README.md b/@vates/coalesce-calls/README.md index 7704653256..c5409faea9 100644 --- a/@vates/coalesce-calls/README.md +++ b/@vates/coalesce-calls/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/coalesce-calls): -``` -> npm install --save @vates/coalesce-calls +```sh +npm install --save @vates/coalesce-calls ``` ## Usage diff --git a/@vates/compose/README.md b/@vates/compose/README.md index d43b8a3b7d..4c646fbcae 100644 --- a/@vates/compose/README.md +++ b/@vates/compose/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/compose): -``` -> npm install --save @vates/compose +```sh +npm install --save @vates/compose ``` ## Usage diff --git a/@vates/decorate-with/README.md b/@vates/decorate-with/README.md index 13e2bc1b39..35f8a1bd14 100644 --- a/@vates/decorate-with/README.md +++ b/@vates/decorate-with/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/decorate-with): -``` -> npm install --save @vates/decorate-with +```sh +npm install --save @vates/decorate-with ``` ## Usage diff --git a/@vates/disposable/README.md b/@vates/disposable/README.md index 8a8fabec78..f9885bfbf6 100644 --- a/@vates/disposable/README.md +++ b/@vates/disposable/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/disposable): -``` -> npm install --save @vates/disposable +```sh +npm install --save @vates/disposable ``` ## Usage diff --git a/@vates/event-listeners-manager/README.md b/@vates/event-listeners-manager/README.md index 5d97f91a49..ea615256d3 100644 --- a/@vates/event-listeners-manager/README.md +++ b/@vates/event-listeners-manager/README.md @@ -8,8 +8,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/event-listeners-manager): -``` -> npm install --save @vates/event-listeners-manager +```sh +npm install --save @vates/event-listeners-manager ``` ## Usage diff --git a/@vates/multi-key-map/README.md b/@vates/multi-key-map/README.md index 534826b437..45ecbe2845 100644 --- a/@vates/multi-key-map/README.md +++ b/@vates/multi-key-map/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/multi-key-map): -``` -> npm install --save @vates/multi-key-map +```sh +npm install --save @vates/multi-key-map ``` ## Usage diff --git a/@vates/nbd-client/README.md b/@vates/nbd-client/README.md index b345e166f9..58b6cd1a12 100644 --- a/@vates/nbd-client/README.md +++ b/@vates/nbd-client/README.md @@ -8,8 +8,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/nbd-client): -``` -> npm install --save @vates/nbd-client +```sh +npm install --save @vates/nbd-client ``` ## Usage diff --git a/@vates/otp/README.md b/@vates/otp/README.md index 19fa947c6f..5f371fb50a 100644 --- a/@vates/otp/README.md +++ b/@vates/otp/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/otp): -``` -> npm install --save @vates/otp +```sh +npm install --save @vates/otp ``` ## Usage diff --git a/@vates/parse-duration/README.md b/@vates/parse-duration/README.md index 9eb87cf17a..de08fbd7a0 100644 --- a/@vates/parse-duration/README.md +++ b/@vates/parse-duration/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/parse-duration): -``` -> npm install --save @vates/parse-duration +```sh +npm install --save @vates/parse-duration ``` ## Usage diff --git a/@vates/predicates/README.md b/@vates/predicates/README.md index 09824a9a04..f27fbfccb4 100644 --- a/@vates/predicates/README.md +++ b/@vates/predicates/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/predicates): -``` -> npm install --save @vates/predicates +```sh +npm install --save @vates/predicates ``` ## Usage diff --git a/@vates/read-chunk/README.md b/@vates/read-chunk/README.md index 34e2e91042..84afc83d75 100644 --- a/@vates/read-chunk/README.md +++ b/@vates/read-chunk/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/read-chunk): -``` -> npm install --save @vates/read-chunk +```sh +npm install --save @vates/read-chunk ``` ## Usage diff --git a/@vates/task/README.md b/@vates/task/README.md index 4fccc44728..c6a2b5348f 100644 --- a/@vates/task/README.md +++ b/@vates/task/README.md @@ -8,8 +8,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/task): -``` -> npm install --save @vates/task +```sh +npm install --save @vates/task ``` ## Usage diff --git a/@vates/toggle-scripts/README.md b/@vates/toggle-scripts/README.md index 711859cf3c..92312b949f 100644 --- a/@vates/toggle-scripts/README.md +++ b/@vates/toggle-scripts/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/toggle-scripts): -``` -> npm install --save @vates/toggle-scripts +```sh +npm install --save @vates/toggle-scripts ``` ## Usage diff --git a/@xen-orchestra/async-map/README.md b/@xen-orchestra/async-map/README.md index 91d06475e8..a6f6814059 100644 --- a/@xen-orchestra/async-map/README.md +++ b/@xen-orchestra/async-map/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/async-map): -``` -> npm install --save @xen-orchestra/async-map +```sh +npm install --save @xen-orchestra/async-map ``` ## Usage diff --git a/@xen-orchestra/audit-core/README.md b/@xen-orchestra/audit-core/README.md index d7846fc9ae..cbaa1d5233 100644 --- a/@xen-orchestra/audit-core/README.md +++ b/@xen-orchestra/audit-core/README.md @@ -8,8 +8,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/audit-core): -``` -> npm install --save @xen-orchestra/audit-core +```sh +npm install --save @xen-orchestra/audit-core ``` ## Contributions diff --git a/@xen-orchestra/backups-cli/README.md b/@xen-orchestra/backups-cli/README.md index 636ccc8a91..6ea92fd65f 100644 --- a/@xen-orchestra/backups-cli/README.md +++ b/@xen-orchestra/backups-cli/README.md @@ -8,8 +8,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/backups-cli): -``` -> npm install --global @xen-orchestra/backups-cli +```sh +npm install --global @xen-orchestra/backups-cli ``` ## Usage diff --git a/@xen-orchestra/backups/README.md b/@xen-orchestra/backups/README.md index 345b66f3fd..5a2a750bc6 100644 --- a/@xen-orchestra/backups/README.md +++ b/@xen-orchestra/backups/README.md @@ -8,8 +8,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/backups): -``` -> npm install --save @xen-orchestra/backups +```sh +npm install --save @xen-orchestra/backups ``` ## Contributions diff --git a/@xen-orchestra/cr-seed-cli/README.md b/@xen-orchestra/cr-seed-cli/README.md index a9707849d0..0e5668c1e4 100644 --- a/@xen-orchestra/cr-seed-cli/README.md +++ b/@xen-orchestra/cr-seed-cli/README.md @@ -8,8 +8,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/cr-seed-cli): -``` -> npm install --global @xen-orchestra/cr-seed-cli +```sh +npm install --global @xen-orchestra/cr-seed-cli ``` ## Contributions diff --git a/@xen-orchestra/cron/README.md b/@xen-orchestra/cron/README.md index 2f29b376ae..c42f364cce 100644 --- a/@xen-orchestra/cron/README.md +++ b/@xen-orchestra/cron/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/cron): -``` -> npm install --save @xen-orchestra/cron +```sh +npm install --save @xen-orchestra/cron ``` ## Usage diff --git a/@xen-orchestra/defined/README.md b/@xen-orchestra/defined/README.md index 1ab86a6994..6176dcc500 100644 --- a/@xen-orchestra/defined/README.md +++ b/@xen-orchestra/defined/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/defined): -``` -> npm install --save @xen-orchestra/defined +```sh +npm install --save @xen-orchestra/defined ``` ## Contributions diff --git a/@xen-orchestra/emit-async/README.md b/@xen-orchestra/emit-async/README.md index 7746f7ac7c..54d20107e0 100644 --- a/@xen-orchestra/emit-async/README.md +++ b/@xen-orchestra/emit-async/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/emit-async): -``` -> npm install --save @xen-orchestra/emit-async +```sh +npm install --save @xen-orchestra/emit-async ``` ## Usage diff --git a/@xen-orchestra/fs/README.md b/@xen-orchestra/fs/README.md index 5d1c707a08..0c1dd26e3b 100644 --- a/@xen-orchestra/fs/README.md +++ b/@xen-orchestra/fs/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/fs): -``` -> npm install --global @xen-orchestra/fs +```sh +npm install --global @xen-orchestra/fs ``` ## Contributions diff --git a/@xen-orchestra/log/README.md b/@xen-orchestra/log/README.md index 23f83b94e2..4cd28c7e89 100644 --- a/@xen-orchestra/log/README.md +++ b/@xen-orchestra/log/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/log): -``` -> npm install --save @xen-orchestra/log +```sh +npm install --save @xen-orchestra/log ``` ## Usage diff --git a/@xen-orchestra/mixin/README.md b/@xen-orchestra/mixin/README.md index b166c60352..742e73b931 100644 --- a/@xen-orchestra/mixin/README.md +++ b/@xen-orchestra/mixin/README.md @@ -8,8 +8,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/mixin): -``` -> npm install --save @xen-orchestra/mixin +```sh +npm install --save @xen-orchestra/mixin ``` ## Usage diff --git a/@xen-orchestra/mixins/README.md b/@xen-orchestra/mixins/README.md index 974836e641..b97c2a5240 100644 --- a/@xen-orchestra/mixins/README.md +++ b/@xen-orchestra/mixins/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/mixins): -``` -> npm install --save @xen-orchestra/mixins +```sh +npm install --save @xen-orchestra/mixins ``` ## Contributions diff --git a/@xen-orchestra/mixins/docs/HttpProxy.md b/@xen-orchestra/mixins/docs/HttpProxy.md index 2a8b1f9474..629d06ff30 100644 --- a/@xen-orchestra/mixins/docs/HttpProxy.md +++ b/@xen-orchestra/mixins/docs/HttpProxy.md @@ -25,7 +25,7 @@ For safety reasons, the proxy requires authentication to be used. Use the authentication token: -``` +```console $ cat ~/.config/xo-proxy/config.z-auto.json {"authenticationToken":"J0BgKritQgPxoyZrBJ5ViafQfLk06YoyFwC3fmfO5wU"} ``` @@ -48,7 +48,7 @@ https://user:password@xo.company.lan Or create a dedicated token with `xo-cli`: -``` +```console $ xo-cli --createToken xoa.company.lan admin@admin.net Password: ******** Successfully logged with admin@admin.net diff --git a/@xen-orchestra/openflow/README.md b/@xen-orchestra/openflow/README.md index 790752c65f..2550c3322a 100644 --- a/@xen-orchestra/openflow/README.md +++ b/@xen-orchestra/openflow/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/openflow): -``` -> npm install --save @xen-orchestra/openflow +```sh +npm install --save @xen-orchestra/openflow ``` ## Usage diff --git a/@xen-orchestra/proxy-cli/README.md b/@xen-orchestra/proxy-cli/README.md index 4a2b933808..0ccc14aee6 100644 --- a/@xen-orchestra/proxy-cli/README.md +++ b/@xen-orchestra/proxy-cli/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/proxy-cli): -``` -> npm install --global @xen-orchestra/proxy-cli +```sh +npm install --global @xen-orchestra/proxy-cli ``` ## Usage diff --git a/@xen-orchestra/self-signed/README.md b/@xen-orchestra/self-signed/README.md index ac0b8a0f3f..111a93e162 100644 --- a/@xen-orchestra/self-signed/README.md +++ b/@xen-orchestra/self-signed/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/self-signed): -``` -> npm install --save @xen-orchestra/self-signed +```sh +npm install --save @xen-orchestra/self-signed ``` ## Usage diff --git a/@xen-orchestra/template/README.md b/@xen-orchestra/template/README.md index ed0df4dc28..fc47c54839 100644 --- a/@xen-orchestra/template/README.md +++ b/@xen-orchestra/template/README.md @@ -8,8 +8,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/template): -``` -> npm install --save @xen-orchestra/template +```sh +npm install --save @xen-orchestra/template ``` ## Usage diff --git a/@xen-orchestra/xapi/README.md b/@xen-orchestra/xapi/README.md index 980eb819e3..423f557a8e 100644 --- a/@xen-orchestra/xapi/README.md +++ b/@xen-orchestra/xapi/README.md @@ -8,8 +8,8 @@ Installation of the [npm package](https://npmjs.org/package/@xen-orchestra/xapi): -``` -> npm install --save @xen-orchestra/xapi +```sh +npm install --save @xen-orchestra/xapi ``` ## Contributions diff --git a/@xen-orchestra/xapi/docs/vm-sync-hook.md b/@xen-orchestra/xapi/docs/vm-sync-hook.md index f00296bdfb..b2241f8247 100644 --- a/@xen-orchestra/xapi/docs/vm-sync-hook.md +++ b/@xen-orchestra/xapi/docs/vm-sync-hook.md @@ -152,7 +152,7 @@ main().catch(console.warn) You can run it manually for testing: -``` -> node index.cjs +```console +$ node index.cjs Server is listening on https://[::]:1727 ``` diff --git a/docs/architecture.md b/docs/architecture.md index 0a7f91bbf5..a5d5245ec3 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -134,8 +134,8 @@ This CLI is mainly used as a debug tool, there's no 100% guarantee on its stabil ### Usage -``` -> xo-cli --help +```console +$ xo-cli --help Usage: xo-cli --register [--allowUnauthorized] [--expiresIn duration] [] @@ -177,8 +177,8 @@ Usage: #### Register your XO instance -``` -> xo-cli --register http://xo.my-company.net admin@admin.net admin +```console +$ xo-cli --register http://xo.my-company.net admin@admin.net admin Successfully logged with admin@admin.net ``` @@ -188,27 +188,27 @@ Note: only a token will be saved in the configuration file. Prints all objects: -``` -> xo-cli --list-objects +```sh +xo-cli --list-objects ``` It is possible to filter on object properties, for instance to print all VM templates: -``` -> xo-cli --list-objects type=VM-template +```sh +xo-cli --list-objects type=VM-template ``` #### List available commands -``` -> xo-cli --list-commands +```sh +xo-cli --list-commands ``` Commands can be filtered using patterns: -``` -> xo-cli --list-commands '{user,group}.*' +```sh +xo-cli --list-commands '{user,group}.*' ``` #### Execute a command @@ -217,8 +217,8 @@ The same syntax is used for all commands: `xo-cli = E.g., adding a new server: -``` -> xo-cli server.add host=my.server.net username=root password=secret-password +```console +$ xo-cli server.add host=my.server.net username=root password=secret-password 42 ``` @@ -228,20 +228,20 @@ Parameters (except `true` and `false` which are correctly parsed as booleans) are assumed to be strings. For other types, you may use JSON encoding by prefixing with `json:`: -``` -> xo-cli foo.bar baz='json:[1, 2, 3]' +```sh +xo-cli foo.bar baz='json:[1, 2, 3]' ``` ##### VM export -``` -> xo-cli vm.export vm=a01667e0-8e29-49fc-a550-17be4226783c @=vm.xva +```sh +xo-cli vm.export vm=a01667e0-8e29-49fc-a550-17be4226783c @=vm.xva ``` ##### VM import -``` -> xo-cli vm.import sr=60a6939e-8b0a-4352-9954-5bde44bcdf7d @=vm.xva +```sh +xo-cli vm.import sr=60a6939e-8b0a-4352-9954-5bde44bcdf7d @=vm.xva ``` > Note: `xo-cli` only supports the import of XVA files. It will not import OVA files. To import OVA images, you must use the XOA web UI or use `xo-upload-ova` [available here](https://github.com/vatesfr/xen-orchestra/blob/master/@xen-orchestra/upload-ova/README.md#xo-upload-ova). diff --git a/docs/backup_troubleshooting.md b/docs/backup_troubleshooting.md index af70bd7a15..1128f10d42 100644 --- a/docs/backup_troubleshooting.md +++ b/docs/backup_troubleshooting.md @@ -116,7 +116,7 @@ Create the following file: Add the following lines: -``` +```toml # XOA Support - Work-around HTTP timeout issue during backups [xapiOptions] httpInactivityTimeout = 1800000 # 30 mins diff --git a/docs/backups.md b/docs/backups.md index 0c699cfd1c..60c06a50e6 100644 --- a/docs/backups.md +++ b/docs/backups.md @@ -248,7 +248,7 @@ First, after your disk is attached to XOA, you'll have to find the new disk name Then, create a filesystem on it: -``` +```sh mkfs.ext4 /dev/xvdb ``` diff --git a/docs/configuration.md b/docs/configuration.md index ebb5395bff..9834b4f167 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -70,16 +70,16 @@ If you use certificates signed by an in-house CA for your XCP-ng or XenServer ho To enable this option in your XOA, create `/etc/systemd/system/xo-server.service.d/ca.conf` with the following content: -``` +```ini [Service] Environment=NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/my-cert.crt ``` Don't forget to reload `systemd` conf and restart `xo-server`: -``` -# systemctl daemon-reload -# systemctl restart xo-server.service +```sh +systemctl daemon-reload +systemctl restart xo-server.service ``` > For XO Proxy, the process is almost the same except the file to create is `/etc/systemd/system/xo-proxy.service.d/ca.conf` and the service to restart is `xo-proxy.service`. diff --git a/docs/continuous_replication.md b/docs/continuous_replication.md index 8be0b60547..7cf1b44374 100644 --- a/docs/continuous_replication.md +++ b/docs/continuous_replication.md @@ -82,14 +82,14 @@ The XOA backup system requires metadata to correctly associate the source snapsh First install the tool (all the following is done from the XOA VM CLI): -``` +```sh sudo npm i -g --unsafe-perm @xen-orchestra/cr-seed-cli ``` Here is an example of how the utility expects the UUIDs and info passed to it: -``` -xo-cr-seed +```console +$ xo-cr-seed Usage: xo-cr-seed xo-cr-seed v0.2.0 @@ -97,8 +97,8 @@ xo-cr-seed v0.2.0 Putting it altogether and putting our values and UUID's into the command, it will look like this (it is a long command): -``` -xo-cr-seed https://root:password@xen1.company.tld 4a21c1cd-e8bd-4466-910a-f7524ecc07b1 https://root:password@xen2.company.tld 5aaf86ca-ae06-4a4e-b6e1-d04f0609e64d 90d11a94-a88f-4a84-b7c1-ed207d3de2f9 369a26f0-da77-41ab-a998-fa6b02c69b9a +```console +$ xo-cr-seed https://root:password@xen1.company.tld 4a21c1cd-e8bd-4466-910a-f7524ecc07b1 https://root:password@xen2.company.tld 5aaf86ca-ae06-4a4e-b6e1-d04f0609e64d 90d11a94-a88f-4a84-b7c1-ed207d3de2f9 369a26f0-da77-41ab-a998-fa6b02c69b9a ``` :::warning @@ -106,8 +106,8 @@ If the username or the password for your XCP-ng/XenServer hosts contains special An easy way to do this with Node in command line: -``` -> node -p 'encodeURIComponent(process.argv[1])' -- 'password with special chars :#@' +```console +$ node -p 'encodeURIComponent(process.argv[1])' -- 'password with special chars :#@' password%20with%20special%20chars%20%3A%23%40 ``` diff --git a/docs/general-troubleshooting.md b/docs/general-troubleshooting.md index 3c587e6500..68475fa49a 100644 --- a/docs/general-troubleshooting.md +++ b/docs/general-troubleshooting.md @@ -4,7 +4,7 @@ If you think you have a problem with your XOA, start by typing`xoa check`command in your terminal: -``` +```console $ xoa check ✔ Node version ✔ Disk space for /var diff --git a/docs/installation.md b/docs/installation.md index fbbb9c62a4..50e11a8377 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -87,7 +87,7 @@ XO needs Node.js. **Please always use latest Node LTS**. We'll consider at this point that you've got a working node on your box. E.g: -``` +```console $ node -v v16.14.0 ``` @@ -106,21 +106,21 @@ XO needs the following packages to be installed. Redis is used as a database by For example, on Debian/Ubuntu: -``` -$ apt-get install build-essential redis-server libpng-dev git python3-minimal libvhdi-utils lvm2 cifs-utils +```sh +apt-get install build-essential redis-server libpng-dev git python3-minimal libvhdi-utils lvm2 cifs-utils ``` On Fedora/CentOS like: -``` -$ dnf install redis libpng-devel git libvhdi-utils lvm2 cifs-utils make automake gcc gcc-c++ +```sh +dnf install redis libpng-devel git libvhdi-utils lvm2 cifs-utils make automake gcc gcc-c++ ``` ### Fetching the Code You need to use the `git` source code manager to fetch the code. Ideally, you should run XO as a non-root user, and if you choose to, you need to set up `sudo` to be able to mount NFS remotes. As your chosen non-root (or root) user, run the following: -``` +```sh git clone -b master https://github.com/vatesfr/xen-orchestra ``` @@ -132,18 +132,18 @@ git clone -b master https://github.com/vatesfr/xen-orchestra Now that you have the code, you can enter the `xen-orchestra` directory and use `yarn` to install other dependencies. Then finally build it using `yarn build`. Be sure to run `yarn` commands as the same user you will be using to run Xen Orchestra: -``` -$ cd xen-orchestra -$ yarn -$ yarn build +```sh +cd xen-orchestra +yarn +yarn build ``` Now you have to create a config file for `xo-server`: -``` -$ cd packages/xo-server -$ mkdir -p ~/.config/xo-server -$ cp sample.config.toml ~/.config/xo-server/config.toml +```sh +cd packages/xo-server +mkdir -p ~/.config/xo-server +cp sample.config.toml ~/.config/xo-server/config.toml ``` > Note: If you're installing `xo-server` as a global service, you may want to copy the file to `/etc/xo-server/config.toml` instead. @@ -152,7 +152,7 @@ In this config file, you can change default ports (80 and 443) for xo-server. If You can try to start xo-server to see if it works. You should have something like this: -``` +```console $ yarn start WebServer listening on localhost:80 [INFO] Default user: "admin@admin.net" with password "admin" @@ -162,8 +162,8 @@ WebServer listening on localhost:80 The only part you need to launch is xo-server, which is quite easy to do. From the `xen-orchestra/packages/xo-server` directory, run the following: -``` -$ yarn start +```sh +yarn start ``` That's it! Use your browser to visit the xo-server IP address, and it works! :) @@ -172,13 +172,13 @@ That's it! Use your browser to visit the xo-server IP address, and it works! :) If you would like to update your current version, enter your `xen-orchestra` directory and run the following: -``` +```sh # This will clear any changes you made in the repository!! -$ git checkout . +git checkout . -$ git pull --ff-only -$ yarn -$ yarn build +git pull --ff-only +yarn +yarn build ``` Then restart Xen Orchestra if it was running. @@ -187,33 +187,36 @@ Then restart Xen Orchestra if it was running. - You can use [forever](https://github.com/nodejitsu/forever) to have the process always running: -``` +```sh yarn global add forever + # Run the below as the user owning XO forever start dist/cli.mjs ``` - Or you can use [forever-service](https://github.com/zapty/forever-service) to install XO as a system service, so it starts automatically at boot. Run the following as root: -``` +```sh yarn global add forever yarn global add forever-service + # Be sure to edit the path below to where your install is located! cd /home/username/xen-orchestra/packages/xo-server/ + # Change the username below to the user owning XO forever-service install orchestra -r username -s dist/cli.mjs ``` The forever-service command above must be run in the xo-server bin directory. Now you can manage the service, and it will start on boot with the machine: -``` +```sh service orchestra start service orchestra status ``` If you need to delete the service: -``` +```sh forever-service delete orchestra ``` @@ -245,7 +248,7 @@ If you have problems during the building phase, follow these steps in your `xen- If you are using FreeBSD, you need to install these packages: -``` +```sh pkg install gmake redis python git npm node autoconf ``` @@ -253,25 +256,25 @@ You can update `npm` itself right now with a `npm update -g` A few of the npm packages look for system binaries as part of their installation, and if missing will try to build it themselves. Installing these will save some time and allow for easier upgrades later: -``` +```sh pkg install jpeg-turbo optipng gifsicle ``` Because FreeBSD is shipped with CLANG and not GCC, you need to do this: -``` +```sh ln -s /usr/bin/clang++ /usr/local/bin/g++ ``` To enable redis on boot, add this in your `/etc/rc.conf`: -``` +```sh redis_enable="YES" ``` Don't forget to start redis if you don't reboot now: -``` +```sh service redis start ``` @@ -281,45 +284,45 @@ service redis start If you are using OpenBSD, you need to install these packages: -``` +```sh pkg_add gmake redis python--%2.7 git node autoconf yarn ``` A few of the npm packages look for system binaries as part of their installation, and if missing will try to build it themselves. Installing these will save some time and allow for easier upgrades later: -``` +```sh pkg_add jpeg optipng gifsicle ``` Because OpenBSD is shipped with CLANG and not GCC, you need to do this: -``` +```sh export CC=/usr/bin/clang export CXX=/usr/bin/clang++ ``` You will need to update the number of allowed open files and make `node` available to `npm` : -``` +```sh ulimit -n 10240 ln -s /usr/local/bin/node /tmp/node ``` If `yarn` cannot find Python, give it an hand : -``` +```sh PYTHON=/usr/local/bin/python2 yarn ``` Enable redis on boot with: -``` +```sh rcctl enable redis ``` Don't forget to start redis if you don't reboot now: -``` +```sh rcctl start redis ``` @@ -327,7 +330,7 @@ rcctl start redis If you are running `xo-server` as a non-root user, you need to use `sudo` to be able to mount NFS remotes. You can do this by editing `xo-server` configuration file and setting `useSudo = true`. It's near the end of the file: -``` +```toml useSudo = true ``` diff --git a/docs/manage_infrastructure.md b/docs/manage_infrastructure.md index 252c1282a8..77afc8b99c 100644 --- a/docs/manage_infrastructure.md +++ b/docs/manage_infrastructure.md @@ -684,7 +684,7 @@ To run Docker as non-root, please add the user you want inside the "Docker" grou Now you need to access your host (Dom0) and use the following command: -``` +```sh xscontainer-prepare-vm -v -u ``` diff --git a/docs/proxy.md b/docs/proxy.md index 11784f72e9..33d5572aa6 100644 --- a/docs/proxy.md +++ b/docs/proxy.md @@ -60,7 +60,7 @@ While creating a standard backup job from your main Xen Orchestra appliance, you Login is disabled by default on proxy appliances. If you need to login for some reason, you need to set a password for the xoa user via the XenStore of the VM. The following is to be ran on your XCP-ng host: -``` +```sh xe vm-param-set uuid= xenstore-data:vm-data/system-account-xoa-password= ``` @@ -77,7 +77,7 @@ After adding the VIF you will need to set an IP for the new NIC, for that you wi Then set the new IP: -``` +```console $ xoa network static eth1 ? Static IP for this machine 192.168.100.120 ? Network mask (eg 255.255.255.0) 255.255.255.0 @@ -85,8 +85,8 @@ $ xoa network static eth1 If you want to set a static address. -``` -$ xoa network dhcp eth1 +```sh +xoa network dhcp eth1 ``` If you prefer using DHCP. diff --git a/docs/restapi.md b/docs/restapi.md index c3797fc3c1..d3ea32d7a4 100644 --- a/docs/restapi.md +++ b/docs/restapi.md @@ -80,10 +80,10 @@ Content-Type: application/json Here is an example with `curl`: -```bash -curl \ - -b authenticationToken=0OQIKwb1WjeHtch25Ls \ - http://xoa.example.com/rest/v0/vms?fields=name_label,power_state +```console +$ curl \ + -b authenticationToken=0OQIKwb1WjeHtch25Ls \ + http://xoa.example.com/rest/v0/vms?fields=name_label,power_state [ { "name_label": "FreeNAS", @@ -125,7 +125,7 @@ Content-Type: application/x-ndjson > This feature is restricted to `name_label` and `name_description` at the moment. -```bash +```sh curl \ -X PATCH \ -b authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ @@ -139,7 +139,7 @@ curl \ For a VM: -```bash +```sh curl \ -X DELETE \ -b authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ @@ -148,7 +148,7 @@ curl \ For a VDI: -```bash +```sh curl \ -X DELETE \ -b authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ @@ -159,7 +159,7 @@ curl \ VDI export and VM export are supported by the API. Below is a simple example to export a VM with `zstd` compression into a `myVM.xva` file: -```bash +```sh curl \ -b authenticationToken=KQxQdm2vMiv7jFEAZXOAGKFkTbs \ 'https://xoa.example.org/rest/v0/vms/770aa52a-fd42-8faf-f167-8c5c4a237a12.xva?compress=zstd' \ @@ -168,7 +168,7 @@ curl \ A VDI can be exported in VHD format at `/rest/v0/vdis/.vhd` or the raw content at `/rest/v0/vdis/.raw`. -```bash +```sh curl \ -b authenticationToken=KQxQdm2vMiv7FkTbs \ 'https://xoa.example.org/rest/v0/vdis/1a269782-ea93-4c4c-897a-475365f7b674.vhd' \ @@ -179,7 +179,7 @@ curl \ A VHD or a raw export can be imported on an SR to create a new VDI at `/rest/v0/srs//vdis`. -```bash +```sh curl \ -X POST \ -b authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 47c8f1361c..0b52dc8f58 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -20,7 +20,7 @@ XOA uses HVM mode. If your physical host doesn't support virtualization extensio As no password is set for the xoa system user by default, you will need to set your own. This can be done via the XenStore data of the VM. The following is to be ran on your XCP-ng host: -``` +```sh xe vm-param-set uuid= xenstore-data:vm-data/system-account-xoa-password= ``` @@ -49,7 +49,6 @@ By default, XOA has a static max memory set to 16GiB. Sometimes you can have tro ``` "Failed","Migrating VM 'XOA' from '' to '' Internal error: Xenops_interface.Internal_error("Domain.Xenguest_failure(\"Error while waiting for suspend notification: xenguest: xc_domain_save: [1] Save failed (0 = Success)\")") - ``` In this case, it means you need to reduce the static max memory field to a lower value, and try again. @@ -77,23 +76,23 @@ All XOA logs are stored in `/var/log/syslog` (on the XO Appliance). To filter only what you need, you can use `journalctl`. Below is an example to filter only logs for `xo-server`: -``` -$ journalctl -u xo-server -f -n 50 +```sh +journalctl -u xo-server -f -n 50 ``` This will return the 50 last lines and tail the file. If you have an error message in your application, start this command and try to reproduce the issue. You'll see clearly what the problem is. You can also filter for the updater program: -``` -$ journalctl -u xoa-updater -f -n 50 +```sh +journalctl -u xoa-updater -f -n 50 ``` ## Configuration XOA is a virtual appliance running Debian with Xen Orchestra installed. If you have any problems, the first thing to do is to use our check service by running the `xoa check` command in a terminal: -``` +```console $ xoa check ✔ Node version ✔ Disk space for /var @@ -146,9 +145,9 @@ You should leave ~512MB for the debian OS itself. Meaning if your VM has 4096MB The last step is to refresh and restart the service: -``` -$ systemctl daemon-reload -$ systemctl restart xo-server +```sh +systemctl daemon-reload +systemctl restart xo-server ``` ### Behind a transparent proxy @@ -157,11 +156,11 @@ If you're behind a transparent proxy, you'll probably have issues with the updat Run the following commands to allow the updater to work: -``` -$ sudo -s -$ echo NODE_TLS_REJECT_UNAUTHORIZED=0 >> /etc/xo-appliance/env -$ npm config -g set strict-ssl=false -$ systemctl restart xoa-updater +```sh +sudo -s +echo NODE_TLS_REJECT_UNAUTHORIZED=0 >> /etc/xo-appliance/env +npm config -g set strict-ssl=false +systemctl restart xoa-updater ``` Now try running an update again. @@ -172,20 +171,20 @@ If the provided certificate is expired, you may want to create a new one. Connect to your appliance via SSH, then as root execute these commands: -``` -$ cd /etc/ssl -$ cp cert.pem cert.pem-old -$ cp key.pem key.pem-old -$ openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -nodes -days 360 -$ systemctl restart xo-server.service +```sh +cd /etc/ssl +cp cert.pem cert.pem-old +cp key.pem key.pem-old +openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -nodes -days 360 +systemctl restart xo-server.service ``` ### Logs The system logs are visible by using this command: -``` -$ tail -f /var/log/syslog +```sh +tail -f /var/log/syslog ``` You can read more about logs [in the dedicated logs chapter](troubleshooting.md#logs). diff --git a/docs/updater.md b/docs/updater.md index 10b3370698..cb5b3d79b7 100644 --- a/docs/updater.md +++ b/docs/updater.md @@ -77,8 +77,8 @@ If your interface is not accessible, or you just prefer to use CLIs commands, it #### Register -``` -# xoa-updater --register +```console +$ xoa-updater --register Successfully connected to xoa-updater-service Please enter your xen-orchestra.com identifiers to register your XOA: @@ -90,21 +90,20 @@ Please enter your xen-orchestra.com identifiers to register your XOA: #### Check for new versions -``` -# xoa-updater +```console +$ xoa-updater Successfully connected to xoa-updater-service Checking new versions...ok ✔ New versions available: xo-server 4.8.1 ℹ xoa-updater may be run again to upgrade packages - ``` #### Upgrade -``` -# xoa-updater --upgrade +```console +$ xoa-updater --upgrade Successfully connected to xoa-updater-service Checking new versions...ok ✔ New versions available: @@ -114,7 +113,6 @@ Downloading packages... Installing new packages... ✔ Your XOA has been successfully updated. - ``` ## Troubleshooting diff --git a/docs/xoa.md b/docs/xoa.md index 97e6a1141f..e3c5966778 100644 --- a/docs/xoa.md +++ b/docs/xoa.md @@ -28,7 +28,7 @@ Open a secure support tunnel so our team can remotely investigate on your XOA. F If your web UI is not working, you can also open the secure support tunnel from the CLI. To open a private tunnel (we are the only one with the private key), you can use the command `xoa support tunnel` like below: -``` +```console $ xoa support tunnel The support tunnel has been created. @@ -60,7 +60,7 @@ Please only use this if you have issues with [the default way to deploy XOA](ins Alternatively, you can deploy it by connecting to your XenServer host and executing the following: -``` +```sh bash -c "$(wget -qO- https://xoa.io/deploy)" ``` @@ -77,7 +77,7 @@ curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protoc It means that the secure HTTPS protocol is not supported, you can bypass this using the unsecure command instead: -``` +```sh bash -c "$(wget -qO- http://xoa.io/deploy)" ``` @@ -107,7 +107,7 @@ If you connect via SSH or console for the first time without using our [web depl Next, you can replace `` with the UUID you found previously, and `` with your password: -``` +```sh xe vm-param-set uuid= xenstore-data:vm-data/system-account-xoa-password= ``` @@ -123,8 +123,8 @@ You can now connect with the `xoa` username and password you defined in the prev To avoid typing `sudo` for any admin command, you can have a root shell with `sudo -s`: -``` -[05:24 27] xoa@xoa:~$ sudo -s +```console +$ sudo -s We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: @@ -134,15 +134,14 @@ Administrator. It usually boils down to these three things: #3) With great power comes great responsibility. [sudo] password for xoa: -[05:24 27] xoa:xoa$ - +$ ``` ## Network configuration XOA uses **DHCP** by default, so if you need to configure the IP address, please run the command `xoa network static`. It will ask you network details: -``` +```console $ xoa network static ? Static IP for this machine 192.168.100.120 ? Network mask (eg 255.255.255.0) 255.255.255.0 @@ -160,7 +159,7 @@ If you want to go back in DHCP, just run `xoa network dhcp` If you need to configure other interfaces than `eth0`, you can use the same commands with the name of the interface to configure as supplementary argument: -``` +```console $ xoa network static eth1 ? Static IP for this machine 192.168.100.120 ? Network mask (eg 255.255.255.0) 255.255.255.0 diff --git a/packages/complex-matcher/README.md b/packages/complex-matcher/README.md index eb8f6ce62b..fcb92c99cb 100644 --- a/packages/complex-matcher/README.md +++ b/packages/complex-matcher/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/complex-matcher): -``` -> npm install --save complex-matcher +```sh +npm install --save complex-matcher ``` ## Usage diff --git a/packages/value-matcher/README.md b/packages/value-matcher/README.md index 310bc2b968..7f9757b0b2 100644 --- a/packages/value-matcher/README.md +++ b/packages/value-matcher/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/value-matcher): -``` -> npm install --save value-matcher +```sh +npm install --save value-matcher ``` ## Usage diff --git a/packages/vhd-cli/README.md b/packages/vhd-cli/README.md index 6630bc4e44..29dd7e4abe 100644 --- a/packages/vhd-cli/README.md +++ b/packages/vhd-cli/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/vhd-cli): -``` -> npm install --global vhd-cli +```sh +npm install --global vhd-cli ``` ## Contributions diff --git a/packages/vhd-lib/README.md b/packages/vhd-lib/README.md index bd4975017a..ba24e4f6a6 100644 --- a/packages/vhd-lib/README.md +++ b/packages/vhd-lib/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/vhd-lib): -``` -> npm install --save vhd-lib +```sh +npm install --save vhd-lib ``` ## Contributions diff --git a/packages/xapi-explore-sr/README.md b/packages/xapi-explore-sr/README.md index 5bce25c934..0b06c9e33e 100644 --- a/packages/xapi-explore-sr/README.md +++ b/packages/xapi-explore-sr/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/xapi-explore-sr): -``` -> npm install --global xapi-explore-sr +```sh +npm install --global xapi-explore-sr ``` ## Usage diff --git a/packages/xen-api/README.md b/packages/xen-api/README.md index 00b6d2577b..053322918d 100644 --- a/packages/xen-api/README.md +++ b/packages/xen-api/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/xen-api): -``` -> npm install --save xen-api +```sh +npm install --save xen-api ``` ## Usage diff --git a/packages/xo-acl-resolver/README.md b/packages/xo-acl-resolver/README.md index 4bf34630f8..ee26928d23 100644 --- a/packages/xo-acl-resolver/README.md +++ b/packages/xo-acl-resolver/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/xo-acl-resolver): -``` -> npm install --save xo-acl-resolver +```sh +npm install --save xo-acl-resolver ``` ## Usage diff --git a/packages/xo-cli/README.md b/packages/xo-cli/README.md index 3e87449b4f..3a767394aa 100644 --- a/packages/xo-cli/README.md +++ b/packages/xo-cli/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/xo-cli): -``` -> npm install --global xo-cli +```sh +npm install --global xo-cli ``` ## Usage diff --git a/packages/xo-collection/README.md b/packages/xo-collection/README.md index ea91b9cbba..d812a2d581 100644 --- a/packages/xo-collection/README.md +++ b/packages/xo-collection/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/xo-collection): -``` -> npm install --save xo-collection +```sh +npm install --save xo-collection ``` ## Usage diff --git a/packages/xo-common/README.md b/packages/xo-common/README.md index 3c57ae13b1..fef96a989a 100644 --- a/packages/xo-common/README.md +++ b/packages/xo-common/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/xo-common): -``` -> npm install --save xo-common +```sh +npm install --save xo-common ``` ## Contributions diff --git a/packages/xo-import-servers-csv/README.md b/packages/xo-import-servers-csv/README.md index 82b69cb5ad..797cc9e7c5 100644 --- a/packages/xo-import-servers-csv/README.md +++ b/packages/xo-import-servers-csv/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/xo-import-servers-csv): -``` -> npm install --global xo-import-servers-csv +```sh +npm install --global xo-import-servers-csv ``` ## Usage diff --git a/packages/xo-lib/README.md b/packages/xo-lib/README.md index b382028bfa..ab44c2aa6a 100644 --- a/packages/xo-lib/README.md +++ b/packages/xo-lib/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/xo-lib): -``` -> npm install --save xo-lib +```sh +npm install --save xo-lib ``` ## Usage diff --git a/packages/xo-remote-parser/README.md b/packages/xo-remote-parser/README.md index caa759d23e..b1839ec81e 100644 --- a/packages/xo-remote-parser/README.md +++ b/packages/xo-remote-parser/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/xo-remote-parser): -``` -> npm install --save xo-remote-parser +```sh +npm install --save xo-remote-parser ``` ## Contributions diff --git a/packages/xo-server/docs/file-restoration.md b/packages/xo-server/docs/file-restoration.md index f6780d80a5..d11feb00d0 100644 --- a/packages/xo-server/docs/file-restoration.md +++ b/packages/xo-server/docs/file-restoration.md @@ -2,10 +2,10 @@ ## Expose VHD disk as block device -``` -> mkdir /tmp/vhd-mount -> vhdimount 20201008T074128Z.vhd /tmp/vhd-mount -> ls /tmp/vhd-mount +```console +$ mkdir /tmp/vhd-mount +$ vhdimount 20201008T074128Z.vhd /tmp/vhd-mount +$ ls /tmp/vhd-mount vhdi1 vhdi2 ``` @@ -14,30 +14,30 @@ vhdi2 When device no longer necessary: -``` -> fusermount -uz /tmp/vhd-mount -> rmdir /tmp/vhd-mount +```console +$ fusermount -uz /tmp/vhd-mount +$ rmdir /tmp/vhd-mount ``` ## List available partitions Partitionned disk: -``` -> partx --bytes --output=NR,START,SIZE,NAME,UUID,TYPE --pairs /tmp/vhd-mount/vhdi2 +```console +$ partx --bytes --output=NR,START,SIZE,NAME,UUID,TYPE --pairs /tmp/vhd-mount/vhdi2 NR="1" START="2048" SIZE="254803968" NAME="" UUID="c8d70417-01" TYPE="0x83" NR="2" START="501758" SIZE="8331985920" NAME="" UUID="c8d70417-02" TYPE="0x5" NR="5" START="501760" SIZE="8331984896" NAME="" UUID="c8d70417-05" TYPE="0x8e" -> echo $? +$ echo $? 0 ``` Non-partionned disk: -``` -> partx --bytes --output=NR,START,SIZE,NAME,UUID,TYPE --pairs /tmp/vhd-mount/vhdi2 +```console +$ partx --bytes --output=NR,START,SIZE,NAME,UUID,TYPE --pairs /tmp/vhd-mount/vhdi2 partx: /tmp/vhd-mount/vhdi2: failed to read partition table -> echo $? +$ echo $? 1 ``` @@ -45,58 +45,58 @@ partx: /tmp/vhd-mount/vhdi2: failed to read partition table > Tip: `offset` and `sizelimit` are only required on a partionned disk -``` -> losetup -o $(($START * 512)) --sizelimit $(($SIZE)) --show -f /tmp/vhd-mount/vhdi2 +```console +$ losetup -o $(($START * 512)) --sizelimit $(($SIZE)) --show -f /tmp/vhd-mount/vhdi2 /dev/loop0 -> pvscan --cache /dev/loop0 +$ pvscan --cache /dev/loop0 ``` When logical volumes no longer necessary: -``` -> pvs --noheading --nosuffix --nameprefixes --unbuffered --units b -o vg_name /dev/loop0 +```console +$ pvs --noheading --nosuffix --nameprefixes --unbuffered --units b -o vg_name /dev/loop0 LVM2_VG_NAME='debian-vg' -> vgchange -an debian-vg -> losetup -d /dev/loop0 +$ vgchange -an debian-vg +$ losetup -d /dev/loop0 ``` ## List available LVM logical volumes -``` -> pvs --noheading --nosuffix --nameprefixes --unbuffered --units b -o lv_name,lv_path,lv_size,vg_name /dev/loop0 +```console +$ pvs --noheading --nosuffix --nameprefixes --unbuffered --units b -o lv_name,lv_path,lv_size,vg_name /dev/loop0 LVM2_LV_NAME='root' LVM2_LV_PATH='/dev/debian-vg/root' LVM2_LV_SIZE='7935623168' LVM2_VG_NAME='debian-vg' LVM2_LV_NAME='swap_1' LVM2_LV_PATH='/dev/debian-vg/swap_1' LVM2_LV_SIZE='394264576' LVM2_VG_NAME='debian-vg' ``` ## Mount LVM logical volume -``` -> vgchange -ay debian-vg -> lvs --noheading --nosuffix --nameprefixes --unbuffered --units b -o lv_name,lv_path +```console +$ vgchange -ay debian-vg +$ lvs --noheading --nosuffix --nameprefixes --unbuffered --units b -o lv_name,lv_path LVM2_LV_NAME='root' LVM2_LV_PATH='/dev/debian-vg/root' LVM2_LV_NAME='swap_1' LVM2_LV_PATH='/dev/debian-vg/swap_1' ``` When logical volume no longer necessary: -``` -> vgchange -an debian-vg +```sh +vgchange -an debian-vg ``` ## Mount block device > Tip: `offset` and `sizelimit` are only required on a partionned disk -``` -> mkdir /tmp/block-mount -> mount --options=loop,ro,norecovery,offset=$(($START * 512)),sizelimit=$(($SIZE)) --source=/tmp/vhd-mount/vhdi2 --target=/tmp/block-mount -> ls /tmp/block-mount +```console +$ mkdir /tmp/block-mount +$ mount --options=loop,ro,norecovery,offset=$(($START * 512)),sizelimit=$(($SIZE)) --source=/tmp/vhd-mount/vhdi2 --target=/tmp/block-mount +$ ls /tmp/block-mount bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys @System.solv tmp usr var ``` When mountpoint no longer necessary: -``` -> umount --lazy /tmp/block-mount -> rmdir /tmp/block-mount +```sh +umount --lazy /tmp/block-mount +rmdir /tmp/block-mount ``` diff --git a/packages/xo-server/docs/rest-api.md b/packages/xo-server/docs/rest-api.md index 40618fc6fb..18d87d4cf1 100644 --- a/packages/xo-server/docs/rest-api.md +++ b/packages/xo-server/docs/rest-api.md @@ -33,7 +33,7 @@ Set-Cookie: authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs Usage with cURL: -```bash +```sh curl -b \ authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ https://xo.company.lan/rest/v0/ @@ -41,7 +41,7 @@ curl -b \ You can use `xo-cli` to create an authentication token: -```bash +```sh $ xo-cli --createToken xoa.company.lan admin@admin.net Password: ******** Successfully logged with admin@admin.net @@ -118,7 +118,7 @@ Content-Type: application/x-ndjson > This feature is restricted to `name_label` and `name_description` at the moment. -```bash +```sh curl \ -X PATCH \ -b authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ @@ -130,7 +130,7 @@ curl \ ## VM destruction -```bash +```sh curl \ -X DELETE \ -b authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ @@ -146,7 +146,7 @@ By default, the XVA is not compressed, however the `compress` query parameter su - `gzip`: use [gzip](https://en.wikipedia.org/wiki/Gzip) compression (very slow) - `zstd`: use [Zstandard](https://en.wikipedia.org/wiki/Zstd) compression (fast, only supported on XCP-ng) -```bash +```sh curl \ -b authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ 'https://xo.company.lan/rest/v0/vms/770aa52a-fd42-8faf-f167-8c5c4a237cac.xva?compress=zstd' \ @@ -155,7 +155,7 @@ curl \ ## VDI destruction -```bash +```sh curl \ -X DELETE \ -b authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ @@ -166,7 +166,7 @@ curl \ A VDI can be exported in VHD format at `/rest/v0/vdis/.vhd` or the raw content at `/rest/v0/vdis/.raw`. -```bash +```sh curl \ -b authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ 'https://xo.company.lan/rest/v0/vdis/1a269782-ea93-4c4c-897a-475365f7b674.vhd' \ @@ -177,7 +177,7 @@ curl \ A VHD or a raw export can be imported on an SR to create a new VDI at `/rest/v0/srs//vdis`. -```bash +```sh curl \ -X POST \ -b authenticationToken=KQxQdm2vMiv7jBIK0hgkmgxKzemd8wSJ7ugFGKFkTbs \ diff --git a/packages/xo-vmdk-to-vhd/README.md b/packages/xo-vmdk-to-vhd/README.md index 2fee252f2f..88ed0e3bdf 100644 --- a/packages/xo-vmdk-to-vhd/README.md +++ b/packages/xo-vmdk-to-vhd/README.md @@ -10,8 +10,8 @@ Installation of the [npm package](https://npmjs.org/package/xo-vmdk-to-vhd): -``` -> npm install --save xo-vmdk-to-vhd +```sh +npm install --save xo-vmdk-to-vhd ``` ## Usage diff --git a/scripts/README.md.tpl b/scripts/README.md.tpl index 8a98b28e18..2ac197ecf0 100644 --- a/scripts/README.md.tpl +++ b/scripts/README.md.tpl @@ -15,8 +15,8 @@ Installation of the [npm package](https://npmjs.org/package/{{pkg.name}}): -``` -> npm install --{{#if pkg.preferGlobal}}global{{^}}save{{/if}} {{pkg.name}} +```sh +npm install --{{#if pkg.preferGlobal}}global{{^}}save{{/if}} {{pkg.name}} ``` {{/unless}}