Skip to content
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

VM IP static configuration #241

Closed
joppino opened this issue Dec 29, 2022 · 5 comments
Closed

VM IP static configuration #241

joppino opened this issue Dec 29, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@joppino
Copy link

joppino commented Dec 29, 2022

Hello, I've opened a similar issue in the terraform ovirt provider which is using this client.

It seems no more possibile to configure the VM main NIC using the initialization parameter nic_configuration as before with the terraform provider.

 initialization {
          dns_search  = "example.com"
          dns_servers = "8.8.8.8"
          host_name   = "temp01.example.com"
          timezone    = "Africa/Nairobi"

          nic_configuration {
              address    = "192.168.10.11"
              boot_proto = "static"
              gateway    = "192.168.10.254"
              label      = "eth0"
              netmask    = "255.255.255.0"
              on_boot    = true
            }
        }

It seems that this is due to the fact that in the current ovirt-client version (v2.1.0) the Initialization contains a Cloud-init custom script and/or the initialization hostname, and nothing more:

// Initialization defines to the virtual machine’s initialization configuration.
type Initialization interface {
	CustomScript() string
	HostName() string
}

So the question is how to replicate the previous behavior. The Ansible module still lets the user specify the initial nic_configuration, but I cannot find a way to replicate this in the current version.

Thanks

@joppino joppino added the documentation Improvements or additions to documentation label Dec 29, 2022
@joppino joppino assigned ghost Dec 29, 2022
@ghost ghost assigned engelmi and unassigned ghost Dec 29, 2022
@engelmi
Copy link
Contributor

engelmi commented Jan 3, 2023

Hi @joppino, you are right - this feature is currently missing in the go-ovirt-client and we would need to add it here in order to enable this in the oVirt terraform provider.
The Initialization interface should be the right place to extend. I'll have a look at it.

@engelmi engelmi added enhancement New feature or request help wanted Extra attention is needed and removed documentation Improvements or additions to documentation labels Jan 3, 2023
@dyens
Copy link

dyens commented Aug 1, 2023

Hi!
@engelmi I would like to add all Initialization arguments to go-ovirt-client. I think, that all of them can be very useful.
I found, that you already work on NicConfiguration parameter cf304db.

After merge your feature, i would like to create PR for other params (and pr for terraform provider). What do you think ?

Also i think, that all of Initialization parameters are optional.
What do you think if save customScript and hostname in constructor for backward compatibility:

func NewInitialization(customScript, hostname string) BuildableInitialization {..} 

And all other parameters should be configured via builder:

initialization := NewInitialization("custom-script", "hostname").WithSomeParam("some-param");

@engelmi
Copy link
Contributor

engelmi commented Aug 3, 2023

Hi @dyens, I created an issue for this (#250) - feel free to assign it to you. I have limited capacity, but I'll make sure to review your contribution and answer questions if some arise.

@engelmi
Copy link
Contributor

engelmi commented Aug 3, 2023

@joppino This has been implemented in #249. I'll create a new release soon. Closing this issue.

@engelmi engelmi closed this as completed Aug 3, 2023
@dyens
Copy link

dyens commented Aug 6, 2023

@engelmi TestVMCreationWithInit in live tests mode does not pass. This PR should fix: #251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants