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

Setting Cluster Ids on Virtual Networks not behaving correctly #6

Closed
benosman opened this issue Dec 6, 2019 · 0 comments
Closed

Setting Cluster Ids on Virtual Networks not behaving correctly #6

benosman opened this issue Dec 6, 2019 · 0 comments
Labels
Milestone

Comments

@benosman
Copy link
Contributor

benosman commented Dec 6, 2019

When setting one or more specific cluster ids without the default cluster in the list (typically 0), the default cluster gets implicitly added.

Given the example:

resource "opennebula_virtual_network" "vnet" {
  name = "tarravnet"
  permissions = "660"
  group = "${opennebula_group.group.name}"
  bridge = "br0"
  physical_device = "eth0"
  type = "fw"
  mtu = 1500
  ar = [ {
    ar_type = "IP4",
    size = 16
    ip4 = "172.16.100.101"
  } ]
  dns = "172.16.100.1"
  gateway = "172.16.100.1"
  security_groups = [ 0 ]
  clusters = [100]
}

This will result in:

clusters        = [
  0,
  100,
]

The sunstone frontend also shows that this default cluster was added implicitly

I believe this is caused by the upstream virtual network controller in the api adding the default cluster automatically if none is specified:

https://github.com/OpenNebula/one/blob/master/src/oca/go/src/goca/virtualnetwork.go#L122-L130

Then this module just adds the list of clusters to the network after creation, without clearing the default first. Compounding this, it seems that this resource doesn't update the list of clusters after updating either, so the list is never checked.

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

No branches or pull requests

2 participants