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

[BUG] BSS bootparameter entities dissapears #56

Open
Masber opened this issue Dec 17, 2024 · 5 comments · May be fixed by #58
Open

[BUG] BSS bootparameter entities dissapears #56

Masber opened this issue Dec 17, 2024 · 5 comments · May be fixed by #58
Assignees
Labels
bug Something isn't working

Comments

@Masber
Copy link

Masber commented Dec 17, 2024

Describe the bug

For some reason, bootparameters gets eventually deleted after running several PATCH requests, I can reproduce this in my local OCHAMI environment.

To Reproduce
Steps to reproduce the behavior:
Deploy OCHAMI using deployment recipes quickstart
Create HSM components

curl --cacert cacert.pem -H "Authorization: Bearer $ACCESS_TOKEN" https://foobar.openchami.cluster:8443/hsm/v2/State/Components
{"Components":[{"ID":"x0c0s1b0n0","Type":"Node","State":"Ready","Flag":"OK","Enabled":true,"Role":"Compute","NID":16416}]}

Add BSS boot parameters

curl --cacert cacert.pem -H "Authorization: Bearer $ACCESS_TOKEN" https://foobar.openchami.cluster:8443/boot/v1/bootparameters \
-d '{"cloud-init":{"meta-data":null,"phone-home":{"fqdn":"","hostname":"","instance_id":"","pub_key_dsa":"","pub_key_ecdsa":"","pub_key_rsa":""},"user-data":null},"hosts":["x1007c0s0b0n1","x1001c1s5b0n1","x1001c1s6b0n0","x1001c1s6b0n1"],"initrd":"test","kernel":"test","params":"param2=2 test param3=3 param1=1 param=0"}'

Check BSS entities

curl --cacert cacert.pem -H "Authorization: Bearer $ACCESS_TOKEN" "https://foobar.openchami.cluster:8443/apis/bss/boot/v1/bootparameters" | jq
[
  {
    "hosts": [
      "x1007c0s0b0n1",
      "x1001c1s5b0n1",
      "x1001c1s6b0n0",
      "x1001c1s6b0n1"
    ],
    "params": "param2=2 test param3=3 param1=1 param=0",
    "kernel": "test",
    "initrd": "test",
    "cloud-init": {
      "meta-data": null,
      "user-data": null,
      "phone-home": {
        "pub_key_dsa": "",
        "pub_key_rsa": "",
        "pub_key_ecdsa": "",
        "instance_id": "",
        "hostname": "",
        "fqdn": ""
      }
    }
  }
]

Update BSS

curl -XPATCH --cacert cacert.pem -H "Authorization: Bearer $ACCESS_TOKEN" https://foobar.openchami.cluster:8443/boot/v1/bootparameters \
-d '{"cloud-init":{"meta-data":null,"phone-home":{"fqdn":"","hostname":"","instance_id":"","pub_key_dsa":"","pub_key_ecdsa":"","pub_key_rsa":""},"user-data":null},"hosts":["x1001c1s5b0n1","x1001c1s6b0n0"],"initrd":"test","kernel":"test","params":"param=0 param3=3"}'

Update BSS again

curl -XPATCH --cacert cacert.pem -H "Authorization: Bearer $ACCESS_TOKEN" https://foobar.openchami.cluster:8443/boot/v1/bootparameters \
-d '{"cloud-init":{"meta-data":null,"phone-home":{"fqdn":"","hostname":"","instance_id":"","pub_key_dsa":"","pub_key_ecdsa":"","pub_key_rsa":""},"user-data":null},"hosts":["x1007c0s0b0n1"],"initrd":"test","kernel":"test","params":"param=0 test param2=2"}'

Up till now, BSS state should be correct

curl --cacert cacert.pem -H "Authorization: Bearer $ACCESS_TOKEN" "https://foobar.openchami.cluster:8443/apis/bss/boot/v1/bootparameters" | jq
[
  {
    "hosts": [
      "x1001c1s6b0n1"
    ],
    "params": "param2=2 test param3=3 param1=1 param=0",
    "kernel": "test",
    "initrd": "test",
    "cloud-init": {
      "meta-data": null,
      "user-data": null,
      "phone-home": {
        "pub_key_dsa": "",
        "pub_key_rsa": "",
        "pub_key_ecdsa": "",
        "instance_id": "",
        "hostname": "",
        "fqdn": ""
      }
    }
  },
  {
    "hosts": [
      "x1001c1s5b0n1",
      "x1001c1s6b0n0"
    ],
    "params": "param=0 param3=3",
    "kernel": "test",
    "initrd": "test",
    "cloud-init": {
      "meta-data": null,
      "user-data": null,
      "phone-home": {
        "pub_key_dsa": "",
        "pub_key_rsa": "",
        "pub_key_ecdsa": "",
        "instance_id": "",
        "hostname": "",
        "fqdn": ""
      }
    }
  },
  {
    "hosts": [
      "x1007c0s0b0n1"
    ],
    "params": "param=0 test param2=2",
    "kernel": "test",
    "initrd": "test",
    "cloud-init": {
      "meta-data": null,
      "user-data": null,
      "phone-home": {
        "pub_key_dsa": "",
        "pub_key_rsa": "",
        "pub_key_ecdsa": "",
        "instance_id": "",
        "hostname": "",
        "fqdn": ""
      }
    }
  }
]

Update BSS one more time, this will trigger some hosts to lost their BSS bootparameters

curl -XPATCH --cacert cacert.pem -H "Authorization: Bearer $ACCESS_TOKEN" https://foobar.openchami.cluster:8443/boot/v1/bootparameters \
-d '{"cloud-init":{"meta-data":null,"phone-home":{"fqdn":"","hostname":"","instance_id":"","pub_key_dsa":"","pub_key_ecdsa":"","pub_key_rsa":""},"user-data":null},"hosts":["x1001c1s5b0n1","x1001c1s6b0n0"],"initrd":"test","kernel":"test","params":"param=0 param3=3"}'

Check BSS bootparameters again

curl --cacert cacert.pem -H "Authorization: Bearer $ACCESS_TOKEN" "https://foobar.openchami.cluster:8443/apis/bss/boot/v1/bootparameters" | jq
[
  {
    "hosts": [
      "x1001c1s6b0n1"
    ],
    "params": "param2=2 test param3=3 param1=1 param=0",
    "kernel": "test",
    "initrd": "test",
    "cloud-init": {
      "meta-data": null,
      "user-data": null,
      "phone-home": {
        "pub_key_dsa": "",
        "pub_key_rsa": "",
        "pub_key_ecdsa": "",
        "instance_id": "",
        "hostname": "",
        "fqdn": ""
      }
    }
  },
  {
    "hosts": [
      "x1007c0s0b0n1"
    ],
    "params": "param=0 test param2=2",
    "kernel": "test",
    "initrd": "test",
    "cloud-init": {
      "meta-data": null,
      "user-data": null,
      "phone-home": {
        "pub_key_dsa": "",
        "pub_key_rsa": "",
        "pub_key_ecdsa": "",
        "instance_id": "",
        "hostname": "",
        "fqdn": ""
      }
    }
  }
]

BSS bootparameters for hosts x1001c1s5b0n1 and x1001c1s6b0n0 missing

Expected behavior
Update the BSS bootparameters for x1001c1s5b0n1 and x1001c1s6b0n0 instead of being deleted

Desktop (please complete the following information):

  • OS: MacOS M3
  • Version sequoia 15.1.1 (running on colima VM with x86_64 architecture with Ubuntu 24.04.1 LTS)

Additional context
I deployed OCHAMI locally using deployment recipes quickstart repo

@Masber Masber added the bug Something isn't working label Dec 17, 2024
@Masber Masber changed the title [BUG] BSS bootparameter entities gets deleted [BUG] BSS bootparameter entities dissapears Dec 17, 2024
@alexlovelltroy
Copy link
Member

Thanks for filing the bug. We'll try and take a look soon.

@synackd
Copy link
Collaborator

synackd commented Dec 22, 2024

I am able to reproduce this. Upon inspecting the database, it looks like the node and boot group assignment data still exists, but the boot group/config data got deleted. I'll dig into this further. Probably something with the Update() function in the postgres library.

@synackd
Copy link
Collaborator

synackd commented Dec 25, 2024

@Masber The above PR should fix this issue. Can you test?

Looks like it was a simple check that was incorrect: it has a ! in front of it when it shouldn't have.

@Masber
Copy link
Author

Masber commented Dec 25, 2024

Hi @synackd ,

yes now it seems to work

thank you

@Masber Masber closed this as completed Dec 25, 2024
@synackd
Copy link
Collaborator

synackd commented Dec 26, 2024

Hi @Masber, I'd like to keep this open until the linked PR is merged, just so we can consider this complete once the changes get merged into main.

@synackd synackd reopened this Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants