Repository navigation
CloudX v1.0.10-rc4
Pre-releaseCloudX v1.0.10
CloudX 1.0.10 confirms a resize that nobody confirmed, replaces the browser console link that pointed nowhere with a noVNC proxy on every compute node, adds domain and system scoped tokens, application credential rotation and trusts, adds three dashboard pages, puts the admin-only actions of every service under an operator-editable policy file, and tightens access checks: the roles of an application credential, the lookup of an application credential, a domain's consolidated invoice, who may change an image, who may read one, who may use one to boot a server or make a volume, which volumes, snapshots, networks, ports, security groups, server groups, consistency groups and schedules a project's users may name, what autoscaling and the metadata proxy may reach, and who may call the bulk usage and metric routes. The changes are in the compute service, the reaper, the compute worker, the identity service, billing, telemetry, the image service, compute and block-store (image use), the other services' admin gates, the dashboard and the packaging. There are three schema changes and upgrade steps (below), and several behaviour changes to read first.
What is new since 1.0.9
Compute API and reaper
- A resize is confirmed automatically.
cloudx-reaperconfirms a server that has waited inVERIFY_RESIZElonger thanRESIZE_CONFIRM_WINDOW_SECONDS(86400 by default;0turns it off), through the publicconfirmResize. The reaper runs everyREAPER_INTERVALseconds (600), so the confirmation comes up to one interval after the window.REAPER_DRY_RUNonly logs. compute-api hasGET /internal/resize-pending?seconds=Nfor the sweep, and the server record has a new column,resize_pending_since(migrationcompute_0005), set by the conductor while the status isVERIFY_RESIZE. A server that an older version leftACTIVEwith a rollback snapshot is not swept.
Compute worker and packaging
- The browser console goes through a proxy on the compute node. A new unit,
cloudx-novnc-proxy, runswebsockifyand the noVNC client on port 6080 of every compute node.console-urlandremote-consolesreturnhttp://<console_proxy_host>:6080/vnc.html?autoconnect=1&path=websockify%3Ftoken=<token>. The guest's VNC stays on127.0.0.1. The token is a JWT signed with a key derived fromauth_secret_key, valid 300 seconds, and good for one VNC port of one libvirt domain on that node (COMPUTE_HOST); the proxy checks the signature and the expiry when the connection opens, then asks libvirt whether the domain still owns the port, and logs every refusal with its reason (never the token). Before, the link wasNOVNC_BASE_URL?host=localhost&port=<vnc port>, and nothing in the packages started a proxy. - The proxy ships in the
cloudx-compute-workerpackage, which now depends onnovnc. The worker's unit hasWants=cloudx-novnc-proxy.serviceand the proxy unit hasPartOf=cloudx-compute-worker.service, so the proxy starts, restarts and stops with the worker; the package does not enable it on its own. On a tarball node the example worker unit ofdocs/tarball-install.mdhas the same line and its start command enables the proxy.console_proxy_hostin/etc/cloudx/compute-worker/compute-worker.confsets the address that goes into the link (default: the node name). Seedocs/console.md.
Identity
- Domain and system scoped tokens.
POST /auth/tokenstakesscopewith one of{"project": ...},{"domain": ...}or{"system": true}. A domain token (for a domain admin of that domain, or an admin) has no project; only auth-api and billing accept it, every other service answers 403project-scoped token required. A system token needs the admin role. - Application credential rotation.
POST /v3/users/{user}/application_credentials/{cred}/rotatewith an optionalgrace_seconds(0 to 86400), during which the replaced secret still works, andcloudx auth appcred rotate USER CRED [--grace-seconds N](migrationauth_0008). - Trusts.
POST|GET /v3/OS-TRUST/trusts,GET|DELETE /v3/OS-TRUST/trusts/{id}andPOST /auth/tokens/trust(migrationauth_0009). A trustor delegates roles it holds in one project to another user; the trustee exchanges the trust for a token that acts as the trustor. Each exchange is written to the audit log astrust.token. The whole feature is described indocs/identity.md. - The roles of an application credential are checked.
rolesmust be a non-empty list without duplicates fromadmin,memberandreader(400 otherwise), and the credential's user must hold every one of them in their project (403 otherwise;admincoversmemberandreader). When an admin creates a credential for another user, the roles are checked against that user. Ifrolesis left out, the credential gets["member"], or the user's own role when they do not holdmember. The check is repeated at every login: the token gets the credential's roles that the user still holds at that moment, and the login answers 401 when none is left. This also applies to credentials created by earlier versions, with no migration. - An application credential is reached through its own user only.
GETandDELETE /v3/users/{user}/application_credentials/{cred}looked a credential up by id without checking its owner. They now look it up among the URL user's own credentials and answer 404 for another user's credential, as rotate already did. A login byapplication_credential_namealone now tries the enabled credentials of that name, at most 5 in the order they were created, and accepts the one whose secret fits; before, it took the first credential of that name and failed when it belonged to another user. A login by id is unchanged.
Policy file
/etc/cloudx/policy.yamldecides the admin-only actions of every service. 57 actions: the 22 ofauth-apiand 35 more (12 of compute, 8 of block-store, 5 of placement, 3 of billing, 2 each of telemetry, networking and object-store, 1 of ha). A rule is a boolean expression ofrole:NAME,domain_admin:True|False,rule:NAME,@,!,and,or,not. Without the file every decision is what it was; a bad rule or file never stops a service. The file is re-read within 2 seconds of a change.cloudx-manage policy check [FILE]validates a file andcloudx-manage policy defaultsprints the built-in rules. The sample is/usr/share/cloudx/policy.yaml.sampleincloudx-common; no package creates/etc/cloudx/policy.yaml. Ownership, visibility and state checks,/internal/...routes and the four bulk billing and telemetry routes stay in code. Seedocs/policy.md.
Image
- Changing an image needs its owner.
PATCH,DELETE,deactivate,reactivate, tags and sharing onimage-apinow require the image's owner, an admin of the owner's domain, or a system admin (the internal token counts as one, soimage-workeris unchanged). The fields the service manages itself (status,size,checksum,object_name,filename,storage_backend) can be set by an admin or the internal token only, and the file store serves only files inside its folder. Upgrade soon. - Reading a non-public image needs the right to read it.
GET /images/{image},download,tags,verify,membersandprefetchonimage-apianswer only to the image's owner, an admin of the owner's domain, a system admin, the internal token, and a project the image was shared with that accepted it (a pending or rejected share grants nothing); anyone else gets404 image '<image>' not found, as for a missing image. A public image is still readable and downloadable without signing in.verify,membersandprefetchstill need a login.GET /imageswith avisibilityfilter applies the project filter too.image-apilogsanonymous read of a non-public image refused: <ref>for each refused anonymous read.compute-workerandblock-store-workersend the internal token when they read an image. - Using an image needs the right to read it. Creating a server from an image, rebuilding or rescuing a server with one, and creating a volume from one (
POST /volumeswithimageorimage_id) fail with404 image '<image>' not found, before anything is created, unless the caller may read the image by the same rule.compute-apiandblock-store-apitellimage-apiwho is asking with a header,X-Caller-Claims(the caller's validated claims: ASCII JSON, at most 2048 bytes, a fixed set of keys), sent together with the internal token. This is a trust of the internal token: whoever holds it can state any identity toimage-api, though the token already makes its holder an admin on every service.image-apiuses the claims only when the internal token is valid; a malformed header makes the caller anonymous (public images only), never an admin; without a valid token the header is ignored. WithINTERNAL_TOKENunset, those services read public images only; the packages always set it.
Project checks (since 1.0.10-rc3)
- Volumes and snapshots named by a user belong to the caller's project. Booting from a volume, cloning a volume or snapshot, and attaching a volume through
POST /volumes/{ref}/attachcheck the project (and the target server's). Compute'sPOST /servers/{ref}/volumes/attachand/detachaccept only an admin or the internal token; users use block-store's routes. The owner of an image made from a volume is the volume's project unless an admin or a service names another. - Networks, ports, security groups and server groups named by a user are checked. Creating a server and adding a port resolve them as the caller: compute sends the caller's identity to networking in
X-Caller-Claims, together with the internal token, so networking's own rules apply (own project, the admin of its domain, shared and external networks). Server groups named by id are checked like those named by name. Ports of new servers belong to the creating project and count against its port quota. A member cannot delete a port a server uses (409). A port with no security group named gets the project'sdefaultgroup, else the installation's.X-Caller-Claimsis now honoured by every user-or-internal route that uses the shared auth middleware, not only byimage-api: a holder of the internal token can state any identity there, which it could already do as an admin; an invalid or duplicated header is401, never admin. - Consistency groups, their snapshots and volume snapshot schedules are answered for the caller's project, the admin of its domain or an admin (
404otherwise; schedules answered403before). A group takes only volumes the caller can see and stores their ids. - Autoscaling acts as the group's project. The orchestration worker calls compute and load-balancer as a member of the group's project (
X-Caller-Claims): servers it starts belong to that project and its quota, and the group's image, network and pool are checked by the services that own them. Scaling history can only be recorded by the worker. - The metadata proxy identifies a VM by its source address and port only. It no longer forwards the VM's query string, quotes the request path and refuses dot segments; its port lookup carries the internal token.
- Smaller fixes. A flavor that is not public is for admins only in compute; a snapshot whose volume is gone is shown to admins only; empty,
.and..references sent to peers answer404; non-ASCII internal-token, metrics-token and health-check headers answer401instead of failing; the quota project in the path is quoted; placement's heartbeat, traits, aggregates, custom resource class and reshaper routes need an admin or the internal token; creating an external network needs an admin.
Billing and telemetry
- The bulk usage and metric calls need an admin or the internal token.
POST /billing/usage-records/batch,POST /billing/cleanup,POST /telemetry/metrics/batchandDELETE /telemetry/metrics/cleanuphave accepted any signed-in user since 0.7.18. The billing and telemetry workers call them with the internal token and are not affected.
Billing
- A domain's consolidated invoice is limited to the system admin and that domain's admin.
GET /billing/invoices?domain_id=<id>addeddomain:<id>to the filter for any caller, so it could return the invoices of a domain the caller does not administer. It now does so only for the system admin and for the admin of that domain; other callers get no domain invoice.POST /billing/invoices?domain_id=<id>answers 403 when the caller is a domain admin of another domain.
Dashboard
- New pages for Trunks, QoS policies and Subnet pools under Networking.
Behaviour changes to read first
- A resize no longer waits forever in
VERIFY_RESIZE. AfterRESIZE_CONFIRM_WINDOW_SECONDS(86400 s, one day) the reaper confirms it, within oneREAPER_INTERVAL(600 s) after that. The statement of 1.0.9 that there is no automatic confirm no longer holds. A script or operator that wants to revert a resize must do it inside the window, or setRESIZE_CONFIRM_WINDOW_SECONDS=0in the reaper's environment to keep the old behaviour. Servers that are inVERIFY_RESIZEat the upgrade get a full window from the upgrade (the migration sets their start time to its own time). - The browser console needs more on every compute node. The
novncpackage (installed by thecloudx-compute-workerpackage;sudo apt install novncon a tarball node, which also needscloudx-novnc-proxyenabled and started); port 6080/tcp reachable from your users' browsers;console_proxy_hostset to an address a browser can reach, or the link holds the node name;auth_secret_key, which the proxy reads from/etc/cloudx/cloudx.conf(the file copied from the controller, as for the worker);COMPUTE_HOSTequal for the worker and the proxy; and the pythonlibvirtbinding in the same venv as the worker (thelibvirt-pythonline of the worker's requirements puts it there).websockifypullsnumpy,jwcryptoandredisinto the venv of every node.NOVNC_BASE_URLis no longer read. A console link is a token valid for 300 seconds and is checked when the connection opens, so a console page that stays open for more than 5 minutes before it connects needs a reload, and a link made by an older compute-api (...?host=localhost&port=..., no token) is not accepted by the proxy. During the upgrade, a new compute-api with a compute worker that is not upgraded yet returnsnovnc_url: nullfromconsole-url, because the old worker does not say which proxy address and libvirt domain to use; it works again once the worker on that node is upgraded. - Application credentials get no more roles than their user holds. Creating one with a role the user does not hold now answers 403, and an empty list, a repeated role or an unknown role name answers 400. At login the token carries only the roles the user still holds, and the login answers 401 when none is left. An existing credential that carries a role its user does not hold therefore gets fewer roles, or stops working. Automation that used such a credential must get a new credential (or a rotation) with roles that the user holds, or the user needs the role. A create call with no
rolesgetsmember(or the user's own role when it does not holdmember). - Another user's application credential answers 404 on
GETandDELETE. A script that showed or deleted a credential through a user reference other than the owner now gets 404; use the owner's user. A login byapplication_credential_namealone tries up to 5 enabled credentials with that name; give the id when there are more. - A domain's consolidated invoice is for the system admin and that domain's admin only.
GET|POST /billing/invoices?domain_id=<id>from anyone else no longer returns or creates it (list: no domain invoice; create: 403). - Domain-scoped tokens and trust tokens have limits. A domain-scoped token is accepted by auth-api and billing only; every other service answers 403
project-scoped token required. A token issued from a trust is read-only against auth-api (logout excepted), never outlives its trust, and keeps working until it expires when the trust is revoked afterwards: revoking a trust stops new exchanges but does not revoke tokens already issued from it. Give a trust a shortexpires_atand a smallremaining_uses. - Schema changes.
compute_0005(compute_servers.resize_pending_since),auth_0008(previous_secret_hashandprevious_valid_untilon application credentials) andauth_0009(theauth_truststable). Runcloudx-manage db sync(see below). This was one schema change in 1.0.9. - The file of rules now matters on every node. If you use a policy file, it must exist, identical, on every node that runs any API service (until now only
auth-apinodes read it). A rule of"!", or one withoutrole:admin, oncompute:service:updateorcompute:server:evacuatestops HA recovery, because the HA monitor's internal token is checked by the same rule;compute:quota:setalso needsidentity:project:quota-setto allow. Runcloudx-manage policy checkon each node. - A denied request on the converted admin routes answers
403withPolicy does not allow <action>instead ofadmin role required. Who is allowed does not change unless a policy file says so. - Only the owner, an admin of the owner's domain or a system admin changes an image, and the bulk billing and telemetry routes answer
403to other users. A script that did either as an ordinary user must use the owner's account or an admin. - A private image is no longer readable by everyone, and no longer usable by everyone. Reading, downloading, listing by
visibility, booting from, rebuilding or rescuing with, and making a volume from an image of another project answer404unless the image is public or shared with your project and accepted. Server snapshots, volume uploads and task imports are private by default; images uploaded through the form default to public. An image another project's user used to boot from by naming it must now be made public or shared (POST /images/{image}/members, then the member accepts). - Image reads from the workers wait for the workers. With
image-apiupgraded and a node'scompute-workerorblock-store-workernot yet upgraded, a boot, rebuild, rescue or volume from a private image on that node fails with404(andimage-apilogs the refused anonymous read) until the worker is upgraded; public images keep working. The window is the time between theimage-apinode and the last worker node; see Upgrading. - A network other projects boot on must be
sharedorexternal. A network an admin created without--sharedand that members of other projects boot on (for example the one indocs/quickstart.md) now answers404 network not foundto them. Make itshared. A domain admin names another project's network by id, not by name. - Servers started by an autoscaling group belong to the group's project. Servers started by a group before the upgrade stay in project
admin: scaling such a group in leaves them running until an admin deletes them (look for<group>-asg-...in projectadmin). A group whose image, network or pool its project cannot use no longer scales out (the worker logs each refusal), and a group needs a public flavor to scale out by itself; manual scaling by an admin is unchanged. A server compute refuses to delete stays in the group and is tried again. - Ports of new servers belong to the creating project, so they count against its port quota and a member can see them; a member cannot delete one that a server uses.
- A flavor that is not public is for admins only in compute (there is no per-project access list). Servers already on one keep working.
- Schedules answer
404, not403, for another project's volume. - Creating an external network needs an admin, and placement's heartbeat, traits, aggregates, custom resource class and reshaper routes need an admin or the internal token.
- The mixed-version window. The identity checks apply once the receiving service and its caller are both new: compute with networking, the orchestration worker with compute and load-balancer. An old service ignores the header and reads the internal token as admin, as before. Upgrade the whole cloud in one pass where you can.
Upgrading
Order: the controllers first (compute API, auth, billing, reaper), then the compute nodes (compute worker, with the new proxy unit). Every node must have all of its CloudX packages at one version. Running VMs are not stopped: QEMU does not run under a CloudX unit. One part of the order is about images (behaviour change 12): upgrade cloudx-compute-worker and cloudx-block-store-worker on the nodes that run them before or soon after the node that runs image-api; a boot from a private image (server snapshots, volume uploads, task imports) on a node whose worker is old fails with 404 until that node is upgraded. On an all-in-one node the packages are installed together and the window is the length of the install. The new X-Caller-Claims check applies once image-api, compute-api and block-store-api are all new, in any order.
From 1.0.9 .deb packages
-
Download the packages of the release and check them (
docs/deb-install.mdsection 3, "Downloading a release"). -
On each node, list what is installed and install the new version of exactly those packages in one command.
--force-confoldkeeps your configuration files:dpkg-query -W -f='${db:Status-Abbrev} ${Package}\n' 'cloudx-*' | awk '$1 ~ /^ii/ {print $2}' sudo apt install -o Dpkg::Options::=--force-confold ./cloudx-common_*.deb ./cloudx-<each package from the list>_*.deb
The package scripts restart the units that were active and leave disabled units disabled. On a compute node apt installs the
novncpackage as a dependency ofcloudx-compute-workerand installs the proxy unit; the worker's unit now hasWants=cloudx-novnc-proxy.service, so the proxy starts when the worker restarts. -
Right after the packages are installed on the first controller (the one with
cloudx-db), apply the schema changes:sudo cloudx-manage db sync
It is safe to run again. Until it has run, the compute API selects
resize_pending_since, a column the table does not have, so requests that read servers fail, and auth selects the two new columns of application credentials, so requests that read application credentials fail, and the trust endpoints have no table. The window is the time between the package install and this command, so run it at once. -
On each compute node: open port 6080/tcp to your users' browsers, set
console_proxy_hostin/etc/cloudx/compute-worker/compute-worker.conf([DEFAULT]) to an address they can reach, and restartcloudx-compute-worker. Check withsystemctl is-active cloudx-novnc-proxy(docs/deb-install.mdsection 4.2, step 6, anddocs/console.md). -
No catalog sync is needed.
systemctl list-units --failed 'cloudx-*'must list nothing. Check that the version took:dpkg-query -W cloudx-commonon each node.
From a tarball install
The tarball install is the legacy path (docs/tarball-install.md); the steps below come from that guide and were not tried for this release. On each node, extract the release tarball to /opt/cloudx, run pip install -r /opt/cloudx/requirements.txt and pip install /opt/cloudx/services --no-deps in /opt/cloudx/venv, copy etc/systemd/*.service to /etc/systemd/system/ and run systemctl daemon-reload. On the first controller apply the schema with sudo CLOUDX_SERVICES_DIR=/opt/cloudx/services /opt/cloudx/venv/bin/cloudx-manage db sync (cloudx-db-migrate, section 2.5 step 6 of the guide, applies the same migrations), then restart the units, controllers first. On each compute node also: sudo apt install novnc; make sure /etc/cloudx/cloudx.conf (with auth_secret_key) is on the node; give the proxy the same COMPUTE_HOST as the worker (a compute_host line in /etc/cloudx/compute-worker/compute-worker.conf serves both); add Wants=cloudx-novnc-proxy.service to a worker unit written by hand, and sudo systemctl enable --now cloudx-novnc-proxy; open port 6080/tcp. Without /usr/share/novnc the proxy unit is skipped without an error and nothing listens on port 6080.
During the upgrade, between the first controller and the last compute node, avoid opening a console of a server on a node that is not upgraded: a new compute-api returns novnc_url: null for it (above). These mixed-version cases come from reading the code; they were not tried.
From 1.0.8 or older, do the earlier upgrades first (docs/releases/v1.0.9.md, docs/releases/v1.0.8.md).
What was and was not tested
- The unit and integration tests pass:
pytest -qgave 2768 passed, 65 skipped on the commit of this release candidate, with #105 to #125 merged. The CIdebjob, which builds the packages and checks their contents, passes. The tests run against fake libvirt, HTTP clients, RPC and a sqlite database, so they show what the code sends, defines and answers, not what libvirt, a browser or Postgres do with it. The changes of #106, #107 and #108 each have new tests that failed on the old code. - Nothing in this release has been run on the lab yet. This release candidate exists to be installed there. The following are what it has to show:
- Resize auto-confirm with a short
RESIZE_CONFIRM_WINDOW_SECONDS, and the conductor SQL that setsresize_pending_sinceon Postgres (theCASE/COALESCEupdate and the timestamp bound as a string ran on sqlite only). - The console of a VM on the controller and of a VM on another compute node: that a browser reaches port 6080, that
COMPUTE_HOSTagrees between the worker and the proxy on.deband on tarball nodes, the real unit with/usr/share/novnc, and that a console tab left idle for more than 5 minutes needs a reload. - The Trunks, QoS policies and Subnet pools pages in a browser. They were built with a Windows
nodeon a copy of the frontend, becausenode_modulesin the checkout only has win32 rollup binaries. - A domain scoped login and a system scoped login, a rotation with
--grace-seconds, and a trust created and redeemed end to end. - The image checks on a real cloud: a member of one project cannot read, download, boot from, rebuild or rescue with, or make a volume from another project's private image (each answers
404); the same member can with a public image, their own image, a server snapshot of their own, and an image shared with their project and accepted; theimage-apilog line for a refused anonymous read; and the upgrade window of behaviour change 12 (an old worker with a newimage-api). - The policy file on a real node set:
cloudx-manage policy checkon each node, a rule that opens or closes one action (for examplecompute:flavor:create), the change taken without a restart, and HA recovery (compute:service:update,compute:server:evacuate) with the file in place. - The upgrade itself from 1.0.9:
cloudx-manage db syncwith the three migrations, a server already inVERIFY_RESIZE, and the mixed-version cases above.
- Resize auto-confirm with a short
- Not planned for this release: live migration, and QoS enforcement on LVM volumes.
Known limitations
- Live migration is not built (
POST /servers/{ref}/live-migrateanswers 501). Use cold migration. - Revoking a trust does not revoke the tokens already issued from it. They expire with the trust, or after
AUTH_TOKEN_EXPIRE_HOURS. - The console link is plain
http. The proxy has no TLS. websockify logs rejected tokens and the URLs of its access lines itself; the tokens live 300 seconds. - A server snapshot images the root volume only, as in 1.0.8.
- OVN version. As in
docs/releases/v1.0.7.md: OVN comes from the Ubuntu 24.04 archive; the lab tests ran on 24.03.8 (noble-updates). An older OVN is outside what CloudX is tested on. - The limits of
docs/releases/v1.0.8.md,docs/releases/v1.0.7.mdanddocs/releases/v1.0.6.mdstill apply.