Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 3.1.0

### Added

- **Console copy devices**: every VM is created with `vga: std,clipboard=vnc` and `serial0: socket`. The node's console offers its configure link to the viewer's clipboard (the noVNC clipboard panel) and writes it to the serial port (the xterm.js console). VNC clipboard needs PVE 8.2, below the 8.4.1 minimum.

## 3.0.0

### Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "arcane-mage"
version = "3.0.0"
version = "3.1.0"
description = "Automation helper for Fluxnodes"
readme = "README.md"
authors = [
Expand Down
7 changes: 7 additions & 0 deletions src/arcane_mage/provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class VmConfig:
ide2: str
net0: str
scsihw: str
vga: str
serial0: str
startup: str | None = None

def to_proxmox_dict(self) -> dict:
Expand Down Expand Up @@ -528,6 +530,11 @@ async def create_vm_config(
ide2=f"{storage_iso}:iso/{iso_name},media=cdrom",
net0=f"model=virtio,bridge={network_bridge}{network_rate}",
scsihw="virtio-scsi-single",
# The node's console offers text to the viewer's clipboard (Proxmox's
# "Clipboard: VNC", PVE 8.2+, below MIN_API_VERSION) and writes it to its
# first serial port (the xterm.js console).
vga="std,clipboard=vnc",
serial0="socket",
startup=startup_config,
)

Expand Down
16 changes: 16 additions & 0 deletions tests/test_provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,22 @@ async def test_create_vm_config_cumulus(self, provisioner: Provisioner, mock_api
assert config.memory == 8192
assert config.cores == 4

async def test_a_vm_has_the_clipboard_channel_and_a_serial_port(
self, provisioner: Provisioner, mock_api: AsyncMock
):
mock_api.get_next_id.return_value = ApiSuccess(payload=100)

config = await provisioner.create_vm_config(
vm_name="test-vm",
tier="cumulus",
network_bridge="vmbr0",
)

assert config is not None
api = config.to_proxmox_dict()
assert api["vga"] == "std,clipboard=vnc"
assert api["serial0"] == "socket"

async def test_create_vm_config_invalid_tier(self, provisioner: Provisioner, mock_api: AsyncMock):
config = await provisioner.create_vm_config(
vm_name="test-vm",
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading