terraform-provider-fortios icon indicating copy to clipboard operation
terraform-provider-fortios copied to clipboard

fortios_system_ha monitor property

Open mathieubrun opened this issue 1 year ago • 2 comments

Hello,

I'm using the 1.19.0 terraform provider to set ha monitor settings.

Setting the monitor property to "internal2 internal5 internal6" works as expected, the 3 interfaces are now monitored :

config system ha set group-name "xxxxxxxx" set mode a-p set password ENC xxxxxxxxxxxxxxxxxxxxxx set hbdev "internal5" 200 "internal6" 0 set override disable set priority 200 set monitor "internal2" "internal5" "internal6" end

However, running a terraform plan returns the following changes:

~ resource "fortios_system_ha" "this" {
      id                               = "SystemHa"
    ~ monitor                          = "\"internal2\" \"internal5\" \"internal6\"  \"internal2\" \"internal5\" \"internal6\"  \"internal2\" \"internal5\" \"internal6\" " -> "internal2 internal5 internal6"
      # (66 unchanged attributes hidden)
      # (1 unchanged block hidden)
  }

In order to avoid plan/apply infinite loop, trying to set the value to \"internal2\" \"internal5\" \"internal6\" \"internal2\" \"internal5\" \"internal6\" \"internal2\" \"internal5\" \"internal6\" yields the following error:

│ Error: Error updating SystemHa resource: Internal Server Error - Internal error when processing the request (500)
│ Cli response:
│ node_check_object fail! for hbdev internal5
│ node_check_object fail! for hbdev internal6
│ Invalid value internal5
│ Invalid value internal6
│ No permisson to change HA setting
│ object check operator error, -37, discard the setting
│ Command fail. Return code -37

mathieubrun avatar Feb 23 '24 09:02 mathieubrun

Hi @mathieubrun ,

Thank you for raising this issue, it looks like API returns an abnormal monitor data, I have reported it to the API team for investigating. sorry for any inconvenience

Thanks, Maxx

MaxxLiu22 avatar Feb 23 '24 22:02 MaxxLiu22

Hello,

Thanks for the feedback !

For information, here is the result of GET call on /api/v2/cmdb/system/ha :

"monitor": [
    {
        "q_origin_key": "internal2",
        "name": "internal2",
        "datasource": "system.interface"
    },
    {
        "q_origin_key": "internal5",
        "name": "internal5",
        "datasource": "system.interface"
    },
    {
        "q_origin_key": "internal6",
        "name": "internal6",
        "datasource": "system.interface"
    }
],

Fortios version is 7.0.12

mathieubrun avatar Feb 26 '24 09:02 mathieubrun