Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage (VM) phase 0.1 #705

Merged
merged 6 commits into from
Aug 26, 2024
Merged

Storage (VM) phase 0.1 #705

merged 6 commits into from
Aug 26, 2024

Conversation

unbel13ver
Copy link
Contributor

@unbel13ver unbel13ver commented Aug 1, 2024

Description of changes

This is the initial implementation of the Storage solution. It uses impermanence framework along with virtiofs shares to make needed files/directories persistent.

Currently it allows to store WiFi configuration, user data from GUI-vm user home directory and common-purpose browser configuration and user sessions/data.

Each VM has an access to it's only data and does not know anything about other stored entities. The host system has an access to all the data stored.

Checklist for things done

  • Summary of the proposed changes in the PR description
  • More detailed description in the commit message(s)
  • Commits are squashed into relevant entities - avoid a lot of minimal dev time commits in the PR
  • Contribution guidelines followed
  • Ghaf documentation updated with the commit - https://tiiuae.github.io/ghaf/
  • PR linked to architecture documentation and requirement(s) (ticket id)
  • Test procedure described (or includes tests). Select one or more:
    • Tested on Lenovo X1 x86_64
    • Tested on Jetson Orin NX or AGX aarch64
    • Tested on Polarfire riscv64
  • Author has run nix flake check --accept-flake-config and it passes
  • All automatic Github Action checks pass - see actions
  • Author has added reviewers and removed PR draft status

Testing

  1. Boot the system. Connect to Wi-Fi network through GUI-VM.
  2. Open Chromium browser, go to any website and add it's address as a bookmark. Close browser window.
  3. Open Business-VM browser (MS365), log in to the Outlook. Close the browser window.
  4. Create any file in user's home directory in GUI-VM: touch ~/testfile
  5. Reboot the computer.
  6. Check that results of 1.-4. are survived the reboot. The Wi-Fi should connect automatically and all bookmarks/sessions/files are in place.

It is possible to restart a microvm without rebooting:
systemctl restart microvm@<vm name>.service

@unbel13ver unbel13ver temporarily deployed to internal-build-workflow August 1, 2024 10:43 — with GitHub Actions Inactive
@unbel13ver unbel13ver marked this pull request as draft August 1, 2024 10:43
@unbel13ver unbel13ver changed the title Impermanence WIP Storage (VM) phase 0.1 Aug 1, 2024
@unbel13ver unbel13ver temporarily deployed to internal-build-workflow August 2, 2024 11:12 — with GitHub Actions Inactive
@unbel13ver unbel13ver temporarily deployed to internal-build-workflow August 15, 2024 12:57 — with GitHub Actions Inactive
@unbel13ver unbel13ver temporarily deployed to internal-build-workflow August 15, 2024 14:13 — with GitHub Actions Inactive
@unbel13ver unbel13ver temporarily deployed to internal-build-workflow August 15, 2024 14:14 — with GitHub Actions Inactive
@unbel13ver unbel13ver temporarily deployed to internal-build-workflow August 16, 2024 12:25 — with GitHub Actions Inactive
@remimimimimi remimimimimi temporarily deployed to internal-build-workflow August 19, 2024 06:25 — with GitHub Actions Inactive
@remimimimimi remimimimimi temporarily deployed to internal-build-workflow August 19, 2024 06:26 — with GitHub Actions Inactive
@unbel13ver unbel13ver requested a review from humaidq-tii August 19, 2024 10:42
@unbel13ver unbel13ver marked this pull request as ready for review August 19, 2024 10:42
@unbel13ver unbel13ver marked this pull request as draft August 19, 2024 10:46
@remimimimimi remimimimimi temporarily deployed to internal-build-workflow August 19, 2024 13:30 — with GitHub Actions Inactive
@remimimimimi remimimimimi temporarily deployed to internal-build-workflow August 19, 2024 13:39 — with GitHub Actions Inactive
@vilvo vilvo temporarily deployed to internal-build-workflow August 20, 2024 07:57 — with GitHub Actions Inactive
@vilvo vilvo force-pushed the impermanence-wip branch from c80f2a1 to a2815ee Compare August 20, 2024 08:02
@vilvo vilvo temporarily deployed to internal-build-workflow August 20, 2024 08:02 — with GitHub Actions Inactive
@vilvo
Copy link
Contributor

vilvo commented Aug 20, 2024

Did a bit of testing with net-vm. Would be good to draft the Testing-section of the PR description to align the expectations/known issues.

Anyway, here goes my findings after nixos-rebuild ... switch + reboot from this PR branch - for TWIMC:

Good:

  • inpermanence works with Wifi credentials - net-vm /etc/NetworkManager/system-connections/<connection-name> stores the credentials (in plain-text) and they persist over reboots
  • wifi gets auto-connected after reboot, name queries from net-vm to DNS work

Regression:

  • No connection applet - can't see from gui-vm desktop if the wifi is connected or not
    -chromium-vm does not start after restart but crashes: fixed with 091c91a

Notes:

  • SSH signatures get regenerated on each reboot like before - to connect, one must either remove the ssh server fingerprints when connecting between ghaf-host <-> -vms OR ignore the server verification. This is not critical as it concerns only -debug-builds and debug-scenarios but would be nice to persist the fingerprints over reboots.

@milva-unikie milva-unikie added bug on Lenovo X1 Carbon Issues found on Lenovo X1 Carbon while checking this PR and removed Needs Testing CI Team to pre-verify labels Aug 22, 2024
@unbel13ver unbel13ver temporarily deployed to internal-build-workflow August 23, 2024 10:08 — with GitHub Actions Inactive
@unbel13ver
Copy link
Contributor Author

The issues with network applet and log collecting are caused by the PCI device enumeration. When persistent storage is enabled, there is a new VirtIO device appear in, for instance, Net-VM:

Before:
00:04.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:05.0 Network controller: Intel Corporation Raptor Lake PCH CNVi WiFi (rev 01)

After:
00:04.0 Mass storage controller: Red Hat, Inc. Virtio file system (rev 01)
00:05.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:06.0 Network controller: Intel Corporation Raptor Lake PCH CNVi WiFi (rev 01)

which causes the Wi-Fi device name change:

Before:
wlp0s5f0

After:
wlp0s6f0

@unbel13ver unbel13ver temporarily deployed to internal-build-workflow August 23, 2024 14:00 — with GitHub Actions Inactive
@unbel13ver unbel13ver added the Needs Testing CI Team to pre-verify label Aug 23, 2024
@milva-unikie
Copy link

Tested on Lenovo-X1 (lenovo-x1-carbon-gen11-debug on USB SSD)

Everything is working!

  • Logs are updated to Grafana
  • Wifi-signal status is shown in taskbar
  • Storage works as described in Testing-section
  • Test-automation passes

@milva-unikie milva-unikie added Tested on Lenovo X1 Carbon This PR has been tested on Lenovo X1 Carbon and removed Needs Testing CI Team to pre-verify bug on Lenovo X1 Carbon Issues found on Lenovo X1 Carbon while checking this PR labels Aug 26, 2024
@unbel13ver unbel13ver temporarily deployed to internal-build-workflow August 26, 2024 12:01 — with GitHub Actions Inactive
@brianmcgillion brianmcgillion temporarily deployed to internal-build-workflow August 26, 2024 12:21 — with GitHub Actions Inactive
@brianmcgillion brianmcgillion temporarily deployed to internal-build-workflow August 26, 2024 12:32 — with GitHub Actions Inactive
@brianmcgillion brianmcgillion temporarily deployed to internal-build-workflow August 26, 2024 14:18 — with GitHub Actions Inactive
unbel13ver and others added 5 commits August 26, 2024 18:19
Signed-off-by: Ivan Nikolaenko <[email protected]>
Signed-off-by: Valentin Kharin <[email protected]>
Also save SSH host keys for VMs that are using storage
services

Signed-off-by: Ivan Nikolaenko <[email protected]>
The fundamental issue is that there is not a hardware.definitions
defined for the non-x86 targets yet. so there is nothing in the config
to evaluate and iterate the pcidevices.

This is a tmp fix.

Signed-off-by: Brian McGillion <[email protected]>
@brianmcgillion brianmcgillion merged commit ec9377d into tiiuae:main Aug 26, 2024
13 of 14 checks passed
@brianmcgillion brianmcgillion deleted the impermanence-wip branch August 26, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tested on Lenovo X1 Carbon This PR has been tested on Lenovo X1 Carbon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants