Open lyarwood opened 1 week ago
The issue you're encountering is due to the fact that disk names in KubeVirt must conform to DNS label rules, which do not allow dots in the names. The virtctl create vm
command does not currently validate the VM name to ensure it can be used as part of a disk name, leading to the error you experienced.
To address this, you can modify the VM name to avoid using dots or any other characters that are not allowed in DNS labels. This will ensure that the disk names derived from the VM name are valid.
Additionally, there are existing validation mechanisms in virtctl
that could be applied to disk names, such as the validateDiskNameAsContainerName
function, which ensures that disk names conform to DNS label rules [1]. Implementing similar validation for VM names during the creation process could prevent such issues in the future.
To continue talking to Dosu, mention @dosu.
@lyarwood despite adding the validation in the admiter( like validateDiskNameAsContainerName
as the dosubot suggested), can we add a validation for vm names in the createVM()
function itself?
@SWITCHin2 If you want to address this, this is the right place to add the validation:
Ohkay. thank you @0xFelix
/cc @0xFelix
What happened:
What you expected to happen: A clear and concise description of what you expected to happen.
How to reproduce it (as minimally and precisely as possible): Steps to reproduce the behavior.
Additional context: Add any other context about the problem here.
Environment:
virtctl version
): N/Akubectl version
): N/Auname -a
): N/A