Description of problem: Cannot add additional service to virtual machine template. Version-Release number of selected component (if applicable): 4.9.3 How reproducible: Always Steps to Reproduce: 1. Add Service to objects[] section of template 2. Create VM from template 3. Actual results: VM created but no additional service Expected results: Expect additional service to be created Additional info: example service definition objects: [...] - kind: Service apiVersion: v1 metadata: name: '${NAME}-www-service' spec: externalTrafficPolicy: Cluster ipFamilies: - IPv4 ports: - protocol: TCP port: 20443 targetPort: 443 type: NodePort selector: kubevirt.io/domain: '${NAME}'
Tom, are you trying to directly edit the managed templates that OpenShift Virtualization provides? If that's the workflow you're using, this shouldn't be supported in the sense that the default templates shouldn't be edited. KubeVirt will automatically revert any changes made. This is by design. What would work is to copy an existing template and create your own.
Template was cloned from rhel8-desktop-large. Attached the full template; maybe I'm not creating it correctly?
@zpeng can you attempt to reproduce this?
Zhe Peng: Can you try to reproduce this bug?
I can reproduce this, but not sure if its a bug. test with build cnv4.9.3 step: 1. create a template with bug descriptions 2. create a vm from the template and start $ oc get vm NAME AGE STATUS READY vm-http-rhel8 49m Running True check service $ oc get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE vm-http-rhel8-ssh-service NodePort 172.30.23.9 <none> 22000:32659/TCP 49m only have default ssh service when I run expose cmd, $ virtctl export virtualmachineinstance vm-http-rhel8 --name nodeport --type NodePort --port 20443 --target-port 443 $ oc get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE nodeport NodePort 172.30.165.190 <none> 20443:31358/TCP 21m vm-http-rhel8-ssh-service NodePort 172.30.23.9 <none> 22000:32659/TCP 49m Hi @Stu, if template have Service section, the vm created from template will expose service automatically?
]$oc -n default process kbid-rhel8-custom-service -p NAME=kbid-custom-svc-vm -p CLOUD_USER_PASSWORD=redhat -o yaml > kbid-custom-svc-template.yaml [kbidarka@localhost ocs]$ oc apply -f kbid-custom-svc-template.yaml virtualmachine.kubevirt.io/kbid-custom-svc-vm created service/kbid-custom-svc-vm-only-truth created Used the above steps to create the VM and SVC using Template.
Considering the above comments 7-11, this appears to be a RFE for the webUI Team, as creating both VM and Service via a Template from CLI does work fine.
NOTE: 1) I used ssh service to test this out ( to avoid further http and certs part) , even though the initial bug description was about https service. 2) As AFAIK, the service in particular does not matter here, to identity the issue.
Moving this to the UX component based on previous comments. Please let me know if this seems like an error.
Templates on UI have no services at all, creating a template from wizard and enable ssh access, there is no services section on details tab.
Note: The UI bug is not supporting objects in a VM Templates, currently the UI only tested for templates that have one vm object. Commont templates have only one vm object, but templates can have more then one object, in this example it's two objects, vm and service. Ronen and Tal hi, supporting more then one object will require going over our code and test/add support for more then one object (mainly in the wizard). IMHO we can move this feature to a JIRA ticket so PM can set the priority, WDYT ?
Let's add it as an RFE
Ugo hi, Note that you also need to inform users that the template they are using will create: vm, service, route .... and not just a vm and after creation inform them that the flowing objects where created. see attached image of how the user is informed when creating a regular application using the console.
Created attachment 1900331 [details] inform users what objects are included in the template
Okay, thanks @yzamir I'm going to bring this to Yifat and we'll explore some options on how to inform the user in the quick create and after the creation. Maybe also on the template details page?
(In reply to Ugo Palatucci from comment #22) > Okay, thanks @yzamir > > I'm going to bring this to Yifat and we'll explore some options on how to > inform the user in the quick create and after the creation. > > Maybe also on the template details page? makes sense to me too :+1:
Created attachment 1900646 [details] Indicating that some additional resources are added when creating a VM from a template This mockup describes how we can inform users that there are some additional resources that are added when creating a VM from a template
apinnick please review the additional section added to the template info drawer indicating that some additional resources are added when creating a VM from a template. Thanks.
@upalatuc I just noted there is a typo in the word "resources" in the mockup. Sorry about that.
Dont' worry. I get it
Created attachment 1903214 [details] Additional resources is added to the template info
Hi @upalatuc Since this info is related to the template info and not to the VM info I think it should be placed in the left column and not the right one in the template info drawer. WDYT? Please see the attachment. Thanks.
Yes, in the drawer the info is in the left column. Only on the template details page, it's on the right. Because there is no space on the left. Here the pr : https://github.com/kubevirt-ui/kubevirt-plugin/pull/810
verified on v4.12.0-125, the service can be added to custom template
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Virtualization 4.12.0 Images security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2023:0408
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days