-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure NIC with static ip #493
Comments
Hello, I opened this issue regarding network configuration using this provider on its current version, then closed it because I tried to read the whole documentation through, both for cloud-init and ovirt, but I seem not to be able getting a clue. The problem which I'm currently experiencing is related to the network configuration of a new VM built from a template using this provider. I cannot, in any way, provide a network configuration to the VM. Previously you could pass a nic_configuration structure to the vm resource, which in turn would configure the network for the VM and everything was good. Now that's gone, so (if I got it right) this must be done with cloud-init and a custom script. But a custom script doesn't let you specify network-data, which must be specified in a datasource, probably of the NoCloud type, which can be provided in an external configuration disk, etc. Before going on that road, I'd need a confirmation that I've understood everything correctly. Static ip network configuration is a very basic configuration option and should be doable in a very simple way. thanks |
Hi @joppino, resource "ovirt_vm" "test" {
cluster_id = "xxx"
template_id = "xxx"
name = "test"
}
resource "ovirt_nic" "test" {
vm_id = ovirt_vm.test.id
vnic_profile_id = "xxx"
name = "eth0"
}
// example based on https://github.com/oVirt/terraform-provider-ovirt/blob/main/internal/ovirt/resource_ovirt_nic_test.go#L27-L41 The vnic_profile has to exist and creating one via this provider (or the underlying go-ovirt-client) is currently not supported as far as I know. |
Thanks @engelmi, I've read that example, but you cannot specify a static IP configuration in the ovirt vnic profile (ovirt 4.4). |
It seems like the usage of network (which was used to set the ip by the old provider, I think), was deprecated to create/update the nic and the support for it in the new provider dropped. |
Thanks for your answers, I understand that wait_for_ip is used to wait for the VM to have an IP. But what I need is to be able to assign a static IP address to the network configuration. Previously it was made in this way in the VM resource:
So the question is how to replicate this behavior in the new provider. Currently from the documentation it seems that we can now just use initialization_hostname and initialization_custom_script (which is a cloud-init config). I think the current situation is due to the switch to the go ovirt client (https://github.com/oVirt/go-ovirt-client/blob/v2.1.0/vm.go) which has the Initialization part allowing only the above two fields:
|
I have the same issue. How to configure the VM to set up an ip addresses? There is any way using init scripts ? |
Do you have some updates ? This is a blocking issue for the new version of this provider |
@joppino I noticed the same issue and I tried to solve it via cloud-init. The problem on cloud-init is to pass vendor-data information on VM creation to use the network module to configure the static IP. I solved using the NM command:
This is cloud-init script
|
Thank you @cello86 for this workaround! As RHV has moved into maintenance, we have basically no capacity to work on this provider. However, if you or someone else have capacity to work on this, we are happy to review any contributions. As soon as this is merged (and maybe a new version is tagged), the tf provider can be extended to support assigning a static IP in the VM initialization. Would you be up for implementing it? @cello86 I can support you, of course. |
Good afternoon https://registry.terraform.io/providers/oVirt/ovirt/latest/docs terraform { |
@MikhailRyzhkin you can find a workaround #493 (comment) |
No description provided.
The text was updated successfully, but these errors were encountered: