Skip to content

[Bug]: DataVolume names are not namespaced per VM — will collide on multi-VM deployments #3

Description

@mrhillsman

Bug Description

DataVolume template names in disk.go and database.go are hardcoded strings ("virtwork-disk-data" and "virtwork-database-data" respectively) without incorporating the VM instance name or index. When deploying multiple VMs of the same workload type via `--vm-count > 1`, all VMs reference the same DataVolume name. This will cause resource conflicts in the Kubernetes API since DataVolume names must be unique within a namespace.

Steps to Reproduce

  1. Run `virtwork run --workloads disk --vm-count 2`
  2. Observe that both VMs attempt to create/reference a DataVolume named `virtwork-disk-data`
  3. The second VM fails due to name conflict

Expected Behavior

DataVolume names should incorporate the VM name or an index suffix (e.g., `virtwork-disk-data-0`, `virtwork-disk-data-1`).

Actual Behavior

All VMs of the same workload type reference identical DataVolume names, causing Kubernetes API resource conflicts.

Command

virtwork run

Workload Type

disk, database

Go Version

Not provided

Deployment Mode

Not provided

Additional Context

Severity: High

Files:

  • `internal/workloads/disk.go:117` — `vm.BuildDataVolumeTemplate("virtwork-disk-data", ...)`
  • `internal/workloads/database.go:127` — `vm.BuildDataVolumeTemplate("virtwork-database-data", ...)`

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.size/SDenotes a PR that changes 10-29 lines, ignoring generated files.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions