Skip to content

vsock guest agent: runtime resource adjustment and network auto-configuration #8

@CMGS

Description

@CMGS

Background

Currently clone/restore supports increasing CPU/Memory/Storage at creation time, but the guest requires manual operations to take effect (online CPU, resize2fs, MAC/IP reconfiguration, etc.). Runtime scaling (CH vm.resize) also faces guest awareness challenges.

Proposal

Establish a host↔guest control channel via vsock (AF_VSOCK), running a lightweight agent inside the guest:

Network Auto-Configuration (Clone Scenario)

  • Host notifies agent of the new MAC/IP configuration via vsock
  • Agent executes ip link set dev ethN address NEW_MAC + IP reconfiguration
  • Replaces current manual post-clone hints

Runtime Resource Adjustment

  • CPU hotplug: Host calls CH vm.resize, then notifies agent → echo 1 > /sys/devices/system/cpu/cpuN/online
  • Memory: virtio-mem kernel driver handles it automatically; balloon requires agent coordination
  • Disk resize: Host resizes COW, then notifies agent → resize2fs / xfs_growfs

Vertical Scaling Loop

Monitoring → trigger scaling → CH resize API → vsock notification to agent → guest auto-adapts, no restart required.

Alternative Approaches Comparison

Approach Applicable To Limitations
cidata/cloud-init bootcmd cloudimg one-time initialization Boot-time only
kernel cmdline OCI direct boot parameter passing Read-only, boot-time only
virtiofs shared directory Config file delivery Requires polling, not real-time
vsock agent All scenarios, runtime Requires agent installed in guest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions