Forum Discussion

Tim_18689's avatar
Tim_18689
Icon for Cirrus rankCirrus
Jun 11, 2015

REST Trying to modify a sys db setup.run

I am trying to disable the first time setup utility remotely using REST. When I make the rest request: -- it looks like it works but the change does not seem to take place on the remote device -- GET requests for the setting show it changed but checking locally show it has not changed

 

I am not understanding something here.

 

I am trying to run the command equivalent to "tmsh modify sys db setup.run value false"

 

-- Here is the value locally on the LTM:

 

tmsh list sys db setup.run

sys db setup.run { value "true" }

 

-- Here I make the rest request to change from "true" to "false":

 

curl -ks -H "Content-Type: application/json" -u admin:admin https://10.3.214.110/mgmt/tm/sys/db/setup.run -X PUT -d '{"value": "false"}' |json-format |grep -v warning {

"kind": "tm:sys:db:dbstate", "name": "setup.run", "fullPath": "setup.run", "generation": 137, "selfLink": "\u003d11.5.0", "defaultValue": "true", "scfConfig": "false", "value": "false", "valueRange": "false true" }

 

Here I check value with a GET request (shows "false": curl -ks -H "Content-Type: application/json" -u admin:admin https://10.3.214.110/mgmt/tm/sys/db/setup.run |json-format |grep -v warning { "kind": "tm:sys:db:dbstate", "name": "setup.run", "fullPath": "setup.run", "generation": 137, "selfLink": "\u003d11.5.0", "defaultValue": "true", "scfConfig": "false", "value": "false", "valueRange": "false true" }

 

-- Here I check locally on LTM and it shows true:

 

tmsh list sys db setup.run

sys db setup.run { value "true" }

 

Any help understanding will be appreciated.

 

  • Tim

6 Replies

  • Sorry, That was a mess, posting again in plain text:

    I am trying to disable the first time setup utility remotely using REST. 
    When I make the rest request: 
    -- it looks like it works but the change does not seem to take place on the remote device
    -- GET requests for the setting show it changed but checking locally show it has not changed
    
    I am not understanding something here.
    
    I am trying to run the command equivalent to "tmsh modify sys db setup.run value false"
    
    -- Here is the value locally on the LTM:
    
     tmsh list sys db setup.run
    
    sys db setup.run {
        value "true"
    }
    
    -- Here I make the rest request to change from "true" to "false":
    
     curl  -ks -H "Content-Type: application/json"  -u admin:admin [https://10.3.214.110/mgmt/tm/sys/db/setup.run](https://10.3.214.110/mgmt/tm/sys/db/setup.run) -X PUT -d '{"value": "false"}' |json-format |grep -v warning                  {
    
    "kind": "tm:sys:db:dbstate",
      "name": "setup.run",
      "fullPath": "setup.run",
      "generation": 137,
      "selfLink": "[https://localhost/mgmt/tm/sys/db/setup.run?ver](https://localhost/mgmt/tm/sys/db/setup.run?ver)\u003d11.5.0",
      "defaultValue": "true",
      "scfConfig": "false",
      "value": "false",
      "valueRange": "false true"
    }
    
    Here I check value with a GET request (shows "false":
      curl  -ks -H "Content-Type: application/json"  -u admin:admin [https://10.3.214.110/mgmt/tm/sys/db/setup.run](https://10.3.214.110/mgmt/tm/sys/db/setup.run)  |json-format |grep -v warning
    {
      "kind": "tm:sys:db:dbstate",
      "name": "setup.run",
      "fullPath": "setup.run",
      "generation": 137,
      "selfLink": "[https://localhost/mgmt/tm/sys/db/setup.run?ver](https://localhost/mgmt/tm/sys/db/setup.run?ver)\u003d11.5.0",
      "defaultValue": "true",
      "scfConfig": "false",
      "value": "false",
      "valueRange": "false true"
    }
    
    -- Here I check locally on LTM and it shows true:
    
     tmsh list sys db setup.run
    
    sys db setup.run {
        value "true"
    }
    
    Any help understanding will be appreciated.
    
    *   Tim
    
    • lostpacket_5555's avatar
      lostpacket_5555
      Historic F5 Account

      PUT https:///mgmt/tm/sys/global-settings -d '{"guiSetup":"disabled"}'

       

       

      Doing this alone will still drop you into the network setup utility when you login to the Configuration utility. So far the only way around this that seems to work is to configure a network object using REST such as a vlan prior to logging on to the CU.

       

      To configure vlans see K13225405: Common iControl REST API command examples. https://support.f5.com/csp/article/K13225405

       

  • Hi Tim,

     

    works for me ok on 11.5.1hf5 - could be a bug, not connecting to the wrong unit by any change - I've done that before..

     

  • Thanks Arpydays for checking. I am trying on 11.6.0 final. I will make sure I am sending to the correct device (good advice). And try on 11.5.x to check that I am not doing something else wrong. Thanks

     

  • this is mine.

     before
    
    [root@ve11d:Active:In Sync] config  tmsh list sys db setup.run
    sys db setup.run {
        value "true"
    }
    [root@ve11d:Active:In Sync] config  tmsh list sys global-settings all-properties
    sys global-settings {
        aws-access-key none
        aws-api-max-concurrency 1
        aws-secret-key none
        console-inactivity-timeout 0
        custom-addr none
        description none
        failsafe-action go-offline-restart-tm
        file-local-path-prefix "{/shared/} {/tmp/}"
        gui-security-banner enabled
        gui-security-banner-text "Welcome to the BIG-IP Configuration Utility.
    
    Log in with your username and password using the fields on the left."
        gui-setup enabled
        host-addr-mode management
        hostname ve11d.acme.local
        hosts-allow-include none
        lcd-display enabled
        mgmt-dhcp disabled
        net-reboot disabled
        password-prompt Password
        quiet-boot enabled
        remote-host none
        username-prompt Username
    }
    [root@ve11d:Active:In Sync] config  curl -sk -u admin:admin https://localhost/mgmt/tm/sys/global-settings | /var/tmp/jq .
    {
      "kind": "tm:sys:global-settings:global-settingsstate",
      "selfLink": "https://localhost/mgmt/tm/sys/global-settings?ver=11.6.0",
      "awsApiMaxConcurrency": 1,
      "consoleInactivityTimeout": 0,
      "customAddr": "none",
      "failsafeAction": "go-offline-restart-tm",
      "fileLocalPathPrefix": "{/shared/} {/tmp/}",
      "guiSecurityBanner": "enabled",
      "guiSecurityBannerText": "Welcome to the BIG-IP Configuration Utility.\n\nLog in with your username and password using the fields on the left.",
      "guiSetup": "enabled",
      "hostAddrMode": "management",
      "hostname": "ve11d.acme.local",
      "lcdDisplay": "enabled",
      "mgmtDhcp": "disabled",
      "netReboot": "disabled",
      "passwordPrompt": "Password",
      "quietBoot": "enabled",
      "usernamePrompt": "Username"
    }
    
     after
    
    [root@ve11d:Active:In Sync] config  curl -sk -u admin:admin https://localhost/mgmt/tm/sys/global-settings -X PUT -H "Content-Type: application/json" -d '{"guiSetup":"disabled"}' | /var/tmp/jq .
    {
      "kind": "tm:sys:global-settings:global-settingsstate",
      "selfLink": "https://localhost/mgmt/tm/sys/global-settings?ver=11.6.0",
      "awsApiMaxConcurrency": 1,
      "consoleInactivityTimeout": 0,
      "customAddr": "none",
      "failsafeAction": "go-offline-restart-tm",
      "fileLocalPathPrefix": "{/shared/} {/tmp/}",
      "guiSecurityBanner": "enabled",
      "guiSecurityBannerText": "Welcome to the BIG-IP Configuration Utility.\n\nLog in with your username and password using the fields on the left.",
      "guiSetup": "disabled",
      "hostAddrMode": "management",
      "hostname": "ve11d.acme.local",
      "lcdDisplay": "enabled",
      "mgmtDhcp": "disabled",
      "netReboot": "disabled",
      "passwordPrompt": "Password",
      "quietBoot": "enabled",
      "usernamePrompt": "Username"
    }
    [root@ve11d:Active:In Sync] config  curl -sk -u admin:admin https://localhost/mgmt/tm/sys/global-settings | /var/tmp/jq .
    {
      "kind": "tm:sys:global-settings:global-settingsstate",
      "selfLink": "https://localhost/mgmt/tm/sys/global-settings?ver=11.6.0",
      "awsApiMaxConcurrency": 1,
      "consoleInactivityTimeout": 0,
      "customAddr": "none",
      "failsafeAction": "go-offline-restart-tm",
      "fileLocalPathPrefix": "{/shared/} {/tmp/}",
      "guiSecurityBanner": "enabled",
      "guiSecurityBannerText": "Welcome to the BIG-IP Configuration Utility.\n\nLog in with your username and password using the fields on the left.",
      "guiSetup": "disabled",
      "hostAddrMode": "management",
      "hostname": "ve11d.acme.local",
      "lcdDisplay": "enabled",
      "mgmtDhcp": "disabled",
      "netReboot": "disabled",
      "passwordPrompt": "Password",
      "quietBoot": "enabled",
      "usernamePrompt": "Username"
    }
    [root@ve11d:Active:In Sync] config  tmsh list sys db setup.run
    sys db setup.run {
        value "false"
    }
    [root@ve11d:Active:In Sync] config  tmsh list sys global-settings
    sys global-settings {
        gui-setup disabled
        hostname ve11d.acme.local
        mgmt-dhcp disabled
    }
    
  • Arpydays was right. I was pointing it at the wrong host. Duh! Thanks Nitass also.