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

Fix Edge gtw several issues #369

Closed
vbauzys opened this issue Oct 28, 2019 · 5 comments
Closed

Fix Edge gtw several issues #369

vbauzys opened this issue Oct 28, 2019 · 5 comments
Assignees

Comments

@vbauzys
Copy link
Contributor

vbauzys commented Oct 28, 2019

  • Create ok, but every next apply will recreate resource:
  # vcd_edgegateway.egw must be replaced
-/+ resource "vcd_edgegateway" "egw" {
        advanced                        = true
        configuration                   = "compact"
      - default_gateway_network         = "vb_externalNet2" -> null # forces replacement
        external_networks               = [
            "vb_externalNet2",
        ]
        fw_default_rule_action          = "deny"
        fw_default_rule_logging_enabled = false
        fw_enabled                      = true
        ha_enabled                      = false
      ~ id                              = "urn:vcloud:gateway:ccfa798e-3d7d-4b8f-ad5a-8cb16c4d2dae" -> (known after apply)
        lb_acceleration_enabled         = false
        lb_enabled                      = false
        lb_logging_enabled              = false
        lb_loglevel                     = "info"
        name                            = "my-egw"
    }

this happens when resource look like this:

resource "vcd_edgegateway" "egw" {
#  org = "my-org"
 #vdc = "my-vdc"

 name                    = "my-egw"
 configuration           = "compact"
 external_networks       = [ "vb_externalNet2"]
}
  • Update issues: A few updatable fields requires recreation
 # vcd_edgegateway.egw2 must be replaced
-/+ resource "vcd_edgegateway" "egw2" {
       advanced                        = true
       configuration                   = "compact"
       default_gateway_network         = "vb_externalNet2"
     ~ description                     = "vaido23" -> "vaido2" # forces replacement
       distributed_routing             = true
       external_networks               = [
           "vb_externalNet2",
       ]
     ~ fw_default_rule_action          = "deny" -> "accept"
       fw_default_rule_logging_enabled = true
     ~ fw_enabled                      = true -> false
     ~ ha_enabled                      = false -> true # forces replacement
     ~ id                              = "urn:vcloud:gateway:5967d707-cdc7-4a99-946c-aeda83d63e37" -> (known after apply)
     ~ lb_acceleration_enabled         = false -> true
     ~ lb_enabled                      = false -> true
     ~ lb_logging_enabled              = false -> true
     ~ lb_loglevel                     = "alert" -> "emergency"
     ~ name                            = "my-egw23" -> "my-egw2" # forces replacement
   }
  • Refresh - won't update field distributed_routing. And if distributed_routing isn't configured it will be
    "distributed_routing": null - IMHO should be false or true.

  • Not informative error (when external network name is wrong)

vcd_edgegateway.egw: Creation complete after 32s [id=urn:vcloud:gateway:5ef80abb-50d0-46b5-90ca-52f33c688633]

Error: error creating edge gateway: &errors.errorString{s:"[ENF] entity not found"}
 
  on main.tf line 224, in resource "vcd_edgegateway" "egw2":
 224: resource "vcd_edgegateway" "egw2" {
  • error state upper case values, but property requires lower case values:
Error: unable to update general load balancer settings: unable to update general load balancer settings: error while updating load balancer config: vShield Edge Invalid Log Level emergency2 was specified for field logging.logLevel. Valid log levels are: EMERGENCY|ALERT|CRITICAL|ERROR|WARNING|NOTICE|INFO|DEBUG. (API error: 10055)
  • Situation which looks ok and strange (edgw created and alive bu with eror in vCD, in state file also exist), but resource creation end up with fail.
vcd_edgegateway.egw2: Still creating... [1m0s elapsed]
vcd_edgegateway.egw2: Still creating... [1m10s elapsed]
 
Error: unable to update general load balancer settings: unable to update general load balancer settings: error while updating load balancer config: vShield Edge Invalid Log Level emergency2 was specified for field logging.logLevel. Valid log levels are: EMERGENCY|ALERT|CRITICAL|ERROR|WARNING|NOTICE|INFO|DEBUG. (API error: 10055)
 
  on main.tf line 224, in resource "vcd_edgegateway" "egw2":
 224: resource "vcd_edgegateway" "egw2" {

And if you change configuration to right one, edgw will still recreated:

 # vcd_edgegateway.egw2 is tainted, so must be replaced
-/+ resource "vcd_edgegateway" "egw2" {
       advanced                        = true
       configuration                   = "compact"
       default_gateway_network         = "vb_externalNet2"
       description                     = "vaido2"
       distributed_routing             = true
       external_networks               = [
           "vb_externalNet2",
       ]
     ~ fw_default_rule_action          = "deny" -> "accept"
       fw_default_rule_logging_enabled = false
     ~ fw_enabled                      = true -> false
       ha_enabled                      = true
     ~ id                              = "urn:vcloud:gateway:55d9c671-6208-4340-83af-6dc596bf5004" -> (known after apply)
     ~ lb_acceleration_enabled         = false -> true
     ~ lb_enabled                      = false -> true
     ~ lb_logging_enabled              = false -> true
     ~ lb_loglevel                     = "info" -> "emergency"
       name                            = "my-egw2"
       org                             = "my1"
       vdc                             = "vbVdc"
   }

Plan: 1 to add, 0 to change, 1 to destroy.
@lvirbalas
Copy link
Collaborator

Create ok, but every next apply will recreate resource
Something is missing in the description of how to reproduce. Maybe it happens when org admin instead of sys admin is used?

@vbauzys
Copy link
Contributor Author

vbauzys commented Oct 28, 2019

@lvirbalas, you can't reproduce? :

this happens when resource look like this:

resource "vcd_edgegateway" "egw" {
  #org = "my-org"
  #vdc = "my-vdc"

 name                    = "my-egw"
 configuration           = "compact"
 external_networks       = [ "vb_externalNet2"]
}

@lvirbalas
Copy link
Collaborator

Thanks, removing default_gateway_network reproduced!

@dataclouder
Copy link
Contributor

Depends on go-vcloud-director issue #202

@Didainius
Copy link
Collaborator

No more investments for NSX-V tech

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

No branches or pull requests

4 participants