Description of problem: After creating a virtual machine, I exposed the ssh port with the following command: virtctl expose vm lars-test-vm-1 --port=22 --name=lars-test-ssh --type=NodePort Which generated the following service: clusterIP: 172.30.94.110 externalTrafficPolicy: Cluster ports: - nodePort: 32733 port: 22 protocol: TCP targetPort: 22 selector: flavor.template.kubevirt.io/medium: 'true' kubevirt.io/domain: lars-test-vm-1 kubevirt.io/size: medium os.template.kubevirt.io/silverblue32: 'true' vm.kubevirt.io/name: lars-test-vm-1 workload.template.kubevirt.io/server: 'true' sessionAffinity: None type: NodePort This worked fine and I was able to connect to the virtual machine by running "ssh -p 32733 <worker-hostname>". I then stopped the virtual machine: virtcl stop lars-test-vm-1 And restarted it: virtctl start lars-test-vm-1 Now I am no longer able to connect to the ssh port on the virtual machine. Additionally, if I delete the service and re-run the `virtctl expose` command, the new NodePort is also unable to connect. Version-Release number of selected component (if applicable): OCP 4.5.13 baremetal CNV 2.4.2 How reproducible: Steps to Reproduce: 1. start new virtual machine 2. expose a service using 'virtctl expose ... --type=NodePort' 3. stop the virtual machine 4. start the virtual machine Actual results: NodePort can no longer access the virtual machine Expected results: I am able to connect to a virtual machine after restarting it.
Lars, does the VM have IP configured after the restart? Services aside, are you able to ping outside network from the VM after the restart?
Petr, I can't reproduce the behavior I was seeing, so maybe something else was going on. There's been an OCP upgrade and a complete power shutdown/restart since then. Maybe I just hadn't had enough coffee.
Hehe, no worries man! I suspect it may have been caused by the guest IP configuration. Sometimes the guest uses its DHCP client on the first boot but (unless configured by the user) not on the second+. Please let me know if this happens again.