Skip to content

Conversation

@LopatinDmitr
Copy link
Contributor

@LopatinDmitr LopatinDmitr commented Dec 11, 2025

Description

This PR adds support for configuring virtual machines without a 'Main' network type in the spec.networks list.

Key changes:

  • Updated NetworksValidator to allow networks without Main type - it no longer requires Main to be the first entry
  • Added validation in IPAMValidator to prevent setting spec.virtualMachineIPAddress when Main network is not configured
  • Modified IPAMHandler to skip IP address processing when no Main network exists
  • Fixed MACHandler to correctly count expected MAC addresses without assuming Main network is present
  • Updated AttachedHandler in VMIP controller to check if VM actually has Main network before attaching
  • Added new DeletionHandler in VMIP controller to clean up VMIP resources when Main network is removed from VM spec
  • Updated CreateNetworkSpec() to include Main network in the interface spec list and filter it during serialization

Why do we need it, and what problem does it solve?

This enables more flexible network configurations for virtual machines. Users may want to create VMs that only use additional networks (via SDN module) without the default pod network. Previously, the Main network was mandatory, which forced all VMs to have the default pod network interface even when it wasn't needed.

What is the expected result?

  1. Create a VM with only additional network interfaces - VM should work correctly with only those interfaces
  2. Attempting to set spec.virtualMachineIPAddress without Main network should be rejected by validation
  3. When Main network is removed from existing VM, associated VMIP resources should be cleaned up automatically

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: vm 
type: feature
summary: "Support network configuration without a 'Main' network type in spec.networks"

@LopatinDmitr LopatinDmitr force-pushed the chore/bump-kubevirt branch 2 times, most recently from 079d50f to eca0f5b Compare December 15, 2025 09:31
@LopatinDmitr LopatinDmitr added this to the v1.4.0 milestone Dec 15, 2025
@LopatinDmitr LopatinDmitr force-pushed the feat/vm/support-configuration-without-main-network branch 2 times, most recently from bb73f3d to e4ffe1b Compare December 15, 2025 16:17
@LopatinDmitr LopatinDmitr force-pushed the chore/bump-kubevirt branch 2 times, most recently from f15923a to e246566 Compare December 15, 2025 18:19
LopatinDmitr and others added 2 commits December 15, 2025 23:30
Signed-off-by: Dmitry Lopatin <dmitry.lopatin@flant.com>
Signed-off-by: Vladislav Panfilov <vladislav.panfilov@flant.com>
@LopatinDmitr LopatinDmitr force-pushed the feat/vm/support-configuration-without-main-network branch 8 times, most recently from e6e3d8a to d4b00b7 Compare December 16, 2025 20:31
Signed-off-by: Dmitry Lopatin <dmitry.lopatin@flant.com>
@LopatinDmitr LopatinDmitr force-pushed the feat/vm/support-configuration-without-main-network branch from d4b00b7 to 4606660 Compare December 16, 2025 20:48
@LopatinDmitr LopatinDmitr changed the title feat(vm): support network configuration without a 'main' network feat(vm): support network configuration without a 'Main' network Dec 16, 2025
@loktev-d loktev-d self-assigned this Dec 17, 2025
@loktev-d loktev-d added e2e/user/loktev-d e2e/run Run e2e test on cluster of PR author labels Dec 17, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Dec 17, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Dec 17, 2025
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
Signed-off-by: Daniil Loktev <lokt.daniil@gmail.com>
@loktev-d loktev-d added the e2e/run Run e2e test on cluster of PR author label Dec 19, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Dec 19, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

LopatinDmitr and others added 4 commits December 19, 2025 12:24
Signed-off-by: Dmitry Lopatin <dmitry.lopatin@flant.com>
Signed-off-by: Vladislav Panfilov <vladislav.panfilov@flant.com>
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>

# Conflicts:
#	build/components/versions.yml
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Dec 19, 2025
…-without-main-network

Signed-off-by: Daniil Loktev <70405899+loktev-d@users.noreply.github.com>
Base automatically changed from chore/bump-kubevirt to main December 19, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants