dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.54k stars 457 forks source link

Support specifying websocket port for VNC #889

Closed klausenbusk closed 2 years ago

klausenbusk commented 2 years ago

Installing a VNC client isn't always a option. In these cases VNC can be accessed over WebSocket with noVNC[1] in the browser.

[1] https://novnc.com

klausenbusk commented 2 years ago

Pinging @dmacvicar per the contributor guidelines.

Changing the graphics options doesn't change the XML (after the initial terraform apply), but it seems unrelated to this change.

dmacvicar commented 2 years ago

Pinging @dmacvicar per the contributor guidelines.

Changing the graphics options doesn't change the XML (after the initial terraform apply), but it seems unrelated to this change.

It was a missing ForceNew in the resource schema. Fixed in 97e9a8a322d1931d55a34ed086e4531472222195.

We have this problem in other resources too and a substantial review is needed.

Additionally, we are not reading back all resources, therefore changes won't be detected if they are modified with any CLI using virDomainUpdateDeviceFlags under the hoods. This includes graphics and the new tpm support.

The overall plan here is to follow model of the network_v2 branch and improve the convention on the methods for schema -> XML and back. That way we could reuse functions to call virDomainUpdateDeviceFlags with changed devices. For now, the code would make things quite complicated, and it is unlikely those devices are changed at runtime.

But implementing read is something we will have to do.