Add Host Primary Disk to registration form

  • Hello FOG Team,

    Almost every machine we are dealing with has more than one hard drive connected, typically one SSD for the OS, one SSD for fast scratch, and one or several for the data.

    I realized that I can specify the SSD for the OS in the Host Management Edit Host Primary Disk, however, I would like to deploy images directly after registration and, therefore, it would be great to be able to set it during this process already.

    I think I can adjust the registration form similiar to that:

    However, I am not sure how I to add the specific entry to the hosts FOG server entry.

    I looked at the API system following this guide:

    And I succesfully did

    curl -H 'fog-api-token: TOKEN' -H 'fog-user-token: TOKEN_USER' -X GET

    and realized that it is the kernelDevice entry of my device that I want to modify.

    Do you have an advise how to put together the respective β€œPOST” command to change this entry or do you have another suggestion how to approach the problem in the first place? πŸ™‚

    Thank you!


  • Ok I also found the answer to my search question:
    The search syntax is slightly different to the news article.

    So here would be an example command for completion:

    curl -H 'fog-api-token: TOKEN' -H 'fog-user-token: TOKEN' -X GET | jq '.hosts[] | select(.name == "HOSTNAME") | .name'

    Thanks again for letting me do my inner monologue on your platform! πŸ™‚


  • Ok that was fast, So I answered my own question with the help of

    curl -H 'fog-api-token: TOKEN' -H 'fog-user-token: TOKEN_USER' -X PUT -d '{"kernelDevice": "/dev/sda"}'

    I checked the API page:

    But it seems that the search option is not working the way I think it works:

    curl -H 'fog-api-token: TOKEN' -H 'fog-user-token: TOKEN_USER' -X GET

    However, my idea for a workaround would be now to parse the host list for the hostname to figure out the HOST_ID and afterwards set the respective entry with the provided infos.
    So now the only thing left is to modify the registration form πŸ™‚