Skip to content

Commit cb3a702

Browse files
committed
Configurable prefix for zfs volume names of base images
1 parent 305130d commit cb3a702

File tree

3 files changed

+23
-20
lines changed

3 files changed

+23
-20
lines changed

.env.example

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ SERVO_CI_GITHUB_API_SCOPE=/repos/delan/servo
44
# Register runners as “name.0@host”, where “host” is a name identifying this host.
55
SERVO_CI_GITHUB_API_SUFFIX=host
66

7-
# Create ZFS volumes as “mypool/ci/name.0”.
7+
# Create libvirt guests as “ci-name.0”. Namespace must not be used by anything else!
8+
SERVO_CI_LIBVIRT_PREFIX=ci
9+
10+
# Create ZFS volumes as “mypool/ci/name.0”. Namespace must not be used by anything else!
811
SERVO_CI_ZFS_PREFIX=mypool/ci
912

10-
# Create libvirt guests as “ci-name.0”.
11-
SERVO_CI_LIBVIRT_PREFIX=ci
13+
# Clone ZFS volumes from “mypool/base/name”. Must be outside $SERVO_CI_ZFS_PREFIX!
14+
SERVO_CI_ZFS_CLONE_PREFIX=mybool/base

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ To build the base vm:
1212
- Windows Server 2019: [17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso](https://software-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66749/17763.3650.221105-1748.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso) (sha256 = 6dae072e7f78f4ccab74a45341de0d6e2d45c39be25f1f5920a2ab4f51d7bcbb)
1313
- VirtIO drivers: [virtio-win-0.1.240.iso](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.240-1/virtio-win-0.1.240.iso) (sha256 = ebd48258668f7f78e026ed276c28a9d19d83e020ffa080ad69910dc86bbcbcc6)
1414
- Create zvol and libvirt guest with random UUID and MAC address
15-
- `zfs create -V 90G mypool/ci/servo-windows2019`
15+
- `zfs create -V 90G mypool/base/servo-windows2019`
1616
- `virsh define windows2019.xml`
17-
- `virt-clone --preserve-data --check path_in_use=off -o servo-windows2019-init -n servo-windows2019 -f /dev/zvol/mypool/ci/servo-windows2019`
17+
- `virt-clone --preserve-data --check path_in_use=off -o servo-windows2019-init -n servo-windows2019 -f /dev/zvol/mypool/base/servo-windows2019`
1818
- `virsh undefine servo-windows2019-init`
1919
- Install Windows Server with desktop experience
2020
- Core can build Servo, but trying to run it yields DeviceOpenFailed in surfman
2121
- Load disk driver from `E:\vioscsi\2k19\amd64`
2222
- Set password for Administrator to `servo2024!`
2323
- Once installed, shut down the guest: `shutdown /s /t 0`
24-
- Take a snapshot: `zfs snapshot mypool/ci/servo-windows2019@0-fresh-install`
24+
- Take a snapshot: `zfs snapshot mypool/base/servo-windows2019@0-fresh-install`
2525
- Update base vm image: `./mount-runner.sh servo-windows2019 $PWD/windows2019/configure-base.sh`
26-
- Take another snapshot: `zfs snapshot mypool/ci/servo-windows2019@1-configure-base`
26+
- Take another snapshot: `zfs snapshot mypool/base/servo-windows2019@1-configure-base`
2727
- Boot base vm guest: `virsh start servo-windows2019`
2828
- The guest will reboot twice, due to the .NET and MSVC installations
2929
- Once installed, shut down the guest: `shutdown /s /t 0`
30-
- Take another snapshot: `zfs snapshot mypool/ci/servo-windows2019@2-ready`
30+
- Take another snapshot: `zfs snapshot mypool/base/servo-windows2019@2-ready`
3131

3232
To clone and start a new runner:
3333

@@ -46,15 +46,15 @@ To build the base vm:
4646
- Windows 10 (multi-edition ISO), English (United States): [Win10_22H2_English_x64v1.iso](https://www.microsoft.com/en-us/software-download/windows10ISO) (sha256 = a6f470ca6d331eb353b815c043e327a347f594f37ff525f17764738fe812852e)
4747
- VirtIO drivers: [virtio-win-0.1.240.iso](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.240-1/virtio-win-0.1.240.iso) (sha256 = ebd48258668f7f78e026ed276c28a9d19d83e020ffa080ad69910dc86bbcbcc6)
4848
- Create zvol and libvirt guest with random UUID and MAC address
49-
- `zfs create -V 90G mypool/ci/servo-windows10`
49+
- `zfs create -V 90G mypool/base/servo-windows10`
5050
- `virsh define windows10.xml`
51-
- `virt-clone --preserve-data --check path_in_use=off -o servo-windows10-init -n servo-windows10 -f /dev/zvol/mypool/ci/servo-windows10`
51+
- `virt-clone --preserve-data --check path_in_use=off -o servo-windows10-init -n servo-windows10 -f /dev/zvol/mypool/base/servo-windows10`
5252
- `virsh undefine servo-windows10-init`
5353
- Install Windows 10 Pro
5454
- Click “I don't have a product key”
5555
- Load disk driver from `E:\vioscsi\w10\amd64`
5656
- Shut down the guest when you see “Let’s start with region. Is this right?”: `virsh shutdown servo-windows10`
57-
- Take a snapshot: `zfs snapshot mypool/ci/servo-windows10@0-fresh-install`
57+
- Take a snapshot: `zfs snapshot mypool/base/servo-windows10@0-fresh-install`
5858
- Boot base vm guest: `virsh start servo-windows10`
5959
- Click “I don’t have internet”
6060
- Click “Continue with limited setup”
@@ -63,15 +63,15 @@ To build the base vm:
6363
- Turn off the six privacy settings
6464
- Click “Not now” for Cortana
6565
- Once installed, shut down the guest: `shutdown /s /t 0`
66-
- Take another snapshot: `zfs snapshot mypool/ci/servo-windows10@1-oobe`
66+
- Take another snapshot: `zfs snapshot mypool/base/servo-windows10@1-oobe`
6767
- Update base vm image: `./mount-runner.sh servo-windows10 $PWD/windows2019/configure-base.sh`
68-
- Take another snapshot: `zfs snapshot mypool/ci/servo-windows10@2-configure-base`
68+
- Take another snapshot: `zfs snapshot mypool/base/servo-windows10@2-configure-base`
6969
- Boot base vm guest: `virsh start servo-windows10`
7070
- Open an elevated PowerShell: **Win**+**X**, **A**
7171
- Allow running scripts: `Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force`
7272
- Run the init script once: `C:\init\init.ps1`
7373
- Once installed, shut down the guest: `shutdown /s /t 0`
74-
- Take another snapshot: `zfs snapshot mypool/ci/servo-windows10@3-ready`
74+
- Take another snapshot: `zfs snapshot mypool/base/servo-windows10@3-ready`
7575

7676
To clone and start a new runner:
7777

@@ -87,9 +87,9 @@ To build the base vm:
8787
- Download images into /var/lib/libvirt/images
8888
- Ubuntu Server 22.04.4: [ubuntu-22.04.4-live-server-amd64.iso](http://mirror.internode.on.net/pub/ubuntu/releases/22.04.4/ubuntu-22.04.4-live-server-amd64.iso)
8989
- Create zvol and libvirt guest with random UUID and MAC address
90-
- `zfs create -V 90G mypool/ci/servo-ubuntu2204`
90+
- `zfs create -V 90G mypool/base/servo-ubuntu2204`
9191
- `virsh define ubuntu2204.xml`
92-
- `virt-clone --preserve-data --check path_in_use=off -o servo-ubuntu2204-init -n servo-ubuntu2204 -f /dev/zvol/mypool/ci/servo-ubuntu2204`
92+
- `virt-clone --preserve-data --check path_in_use=off -o servo-ubuntu2204-init -n servo-ubuntu2204 -f /dev/zvol/mypool/base/servo-ubuntu2204`
9393
- `virsh undefine servo-ubuntu2204-init`
9494
- Install Ubuntu
9595
- Uncheck “Set up this disk as an LVM group”
@@ -98,12 +98,12 @@ To build the base vm:
9898
- Check “Install OpenSSH server”
9999
- Uncheck “Allow password authentication over SSH”
100100
- Once installed, shut down the guest
101-
- Take a snapshot: `zfs snapshot mypool/ci/servo-ubuntu2204@0-fresh-install`
101+
- Take a snapshot: `zfs snapshot mypool/base/servo-ubuntu2204@0-fresh-install`
102102
- Update base vm image: `./mount-runner.sh servo-ubuntu2204 $PWD/ubuntu2204/configure-base.sh`
103-
- Take another snapshot: `zfs snapshot mypool/ci/servo-ubuntu2204@1-configure-base`
103+
- Take another snapshot: `zfs snapshot mypool/base/servo-ubuntu2204@1-configure-base`
104104
- Boot base vm guest: `virsh start servo-ubuntu2204`
105105
- Once installed, shut down the guest
106-
- Take another snapshot: `zfs snapshot mypool/ci/servo-ubuntu2204@2-ready`
106+
- Take another snapshot: `zfs snapshot mypool/base/servo-ubuntu2204@2-ready`
107107

108108
To clone and start a new runner:
109109

create-runner.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ done
1313
vm=$base_vm.$i
1414
>&2 printf '[*] Creating runner: %s\n' $vm
1515

16-
zfs clone $SERVO_CI_ZFS_PREFIX/{$base_snapshot,$vm}
16+
zfs clone $SERVO_CI_ZFS_CLONE_PREFIX/$base_snapshot $SERVO_CI_ZFS_PREFIX/$vm
1717
while ! test -e /dev/zvol/$SERVO_CI_ZFS_PREFIX/$vm-part2; do
1818
sleep 1
1919
done

0 commit comments

Comments
 (0)