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

Support Virtual Network scheduling (NETWORK_MODE = "auto") on virtual machine nics #477

Closed
jamie-pate opened this issue Jul 28, 2023 · 2 comments · Fixed by #502
Closed

Comments

@jamie-pate
Copy link

Description

https://docs.opennebula.io/6.2/management_and_operations/capacity_planning/scheduling.html#scheduling-virtual-networks

There is already a sched_requirements property on the opennebula_virtual_machine and opennebula_template definition, so it would make sense to carry this through to the nic structure.

I propose to add a mechanism to enable NETWORK_MODE=auto and other parameters to automatically determine the NIC to attach to a VM and Template.

It could look something like this:

nic {
  network_mode = "auto"
  sched_requirements = "TRAFFIC_TYPE = \"public\" "
  sched_rank = "-USED_LEASES"
]

This would enable automatic nic scheduling for VMs and reduce the terraform resources needed to set up a VM
From the docs:

NIC = [ NETWORK_MODE = "auto",
        SCHED_REQUIREMENTS = "TRAFFIC_TYPE = \"public\"",
        SCHED_RANK = "-USED_LEASES" ]

New or affected resources and data sources

opennebula_virtual_machine and opennebula_template

Potential terraform configuration

resource "opennebula_virtual_machine" "my_vm" {
//...
nic {
  network_mode = "auto"
  sched_requirements = "TRAFFIC_TYPE = \"public\" "
  sched_rank = "-USED_LEASES"
]
}
resource "opennebula_template" "my_template" {
//...
nic {
  network_mode = "auto"
  sched_requirements = "TRAFFIC_TYPE = \"public\" "
  sched_rank = "-USED_LEASES"
]
}


### References

https://docs.opennebula.io/6.2/management_and_operations/capacity_planning/scheduling.html#scheduling-virtual-networks

NIC = [ NETWORK_MODE = "auto",
SCHED_REQUIREMENTS = "TRAFFIC_TYPE = "public"",
SCHED_RANK = "-USED_LEASES" ]

@jamie-pate
Copy link
Author

Might be handy for datastores also?

@treywelsh
Copy link
Collaborator

treywelsh commented Oct 11, 2023

For the disk with datastore scheduling open an other issue, please.

At first glance:

  • this PR has impact on template and virtual_machine resources: there's several configs to test: when instantiating a VM from a template or when creating a VM from scratch (i.e. a goca dynamic template)
  • we may want to modify the network_id attribute to make it optional and conflicting with network_auto
  • NIC update code should be checked carefully.

This will require careful testing regarding the tests cases to cover, the complexity of nic management code etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants