[RSD] Deleting a machine directly still leaves it composed in the pod

Bug #1667267 reported by Brendan Donegan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Critical
Newell Jensen
MAAS RSD
Invalid
Critical
Newell Jensen

Bug Description

If I manually compose machines in MAAS using the 'pod compose' endpoint, then delete them directly using the machines endpoint, then delete the pod, when I recreate the pod, those machines are still present.

The intended behaviour is that machines composed *by MAAS* should be *decomposed* when deleted and therefore not be auto-discovered when the pod is created. Only machines that MAAS did *not* create should be left composed when they or the pod are deleted.

Tags: rsd
Changed in maasrsd:
milestone: none → beta
Changed in maas:
milestone: none → 2.2.0
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

per @roaksoax request I check if deleting the pod *without* deleting the machines makes them actually decompose - the answer is, no

Changed in maas:
status: New → Triaged
Changed in maasrsd:
status: New → Triaged
Changed in maas:
importance: Undecided → Critical
Changed in maasrsd:
importance: Undecided → Critical
Changed in maas:
assignee: nobody → Newell Jensen (newell-jensen)
Changed in maasrsd:
assignee: nobody → Newell Jensen (newell-jensen)
Revision history for this message
Newell Jensen (newell-jensen) wrote :
Download full text (4.7 KiB)

I am not seeing what Brendan is mentioning in #1. I see this:

root@maas-dev:~# curl -s -k -u admin:admin -X GET https://10.3.0.1:8443/redfish/v1/Nodes
{
  "@odata.context" : "/redfish/v1/$metadata#Nodes",
  "@odata.id" : "/redfish/v1/Nodes",
  "@odata.type" : "#ComposedNodeCollection.ComposedNodeCollection",
  "Name" : "Composed Nodes Collection",
  "<email address hidden>" : 4,
  "Members" : [ {
    "@odata.id" : "/redfish/v1/Nodes/226"
  }, {
    "@odata.id" : "/redfish/v1/Nodes/255"
  }, {
    "@odata.id" : "/redfish/v1/Nodes/256"
  }, {
    "@odata.id" : "/redfish/v1/Nodes/257"
  } ],
  "Actions" : {
    "#ComposedNodeCollection.Allocate" : {
      "target" : "/redfish/v1/Nodes/Actions/Allocate"
    }
  }
root@maas-dev:~# maas admin pods create type="rsd" power_address="10.3.0.1:8443" power_user="admin" power_pass="admin"
Success.
Machine-readable output follows:
{
    "architectures": [
        "amd64/generic"
    ],
    "used": {
        "local_disks": 4,
        "memory": 124992,
        "cores": 176,
        "local_storage": 479999999996
    },
    "total": {
        "local_disks": 7,
        "memory": 249984,
        "cores": 352,
        "local_storage": 959999999999
    },
    "name": "loving-bison",
    "type": "rsd",
    "resource_uri": "/MAAS/api/2.0/pods/190/",
    "available": {
        "local_disks": 3,
        "memory": 124992,
        "local_storage": 480000000003,
        "cores": 176
    },
    "id": 190,
    "capabilities": [
        "composable",
        "fixed_local_storage"
    ]
}
root@maas-dev:~# maas admin pods read
Success.
Machine-readable output follows:
[
    {
        "total": {
            "local_storage": 959999999999,
            "cores": 352,
            "memory": 249984,
            "local_disks": 7
        },
        "available": {
            "cores": 176,
            "local_disks": 3,
            "memory": 124992,
            "local_storage": 480000000003
        },
        "id": 190,
        "architectures": [
            "amd64/generic"
        ],
        "name": "loving-bison",
        "type": "rsd",
        "capabilities": [
            "composable",
            "fixed_local_storage"
        ],
        "used": {
            "local_storage": 479999999996,
            "cores": 176,
            "memory": 124992,
            "local_disks": 4
        },
        "resource_uri": "/MAAS/api/2.0/pods/190/"
    }
]
root@maas-dev:~# for i in {1..4}; do maas admin pod compose 190; done
Success.
Machine-readable output follows:
{
    "system_id": "spfkee",
    "resource_uri": "/MAAS/api/2.0/machines/spfkee/"
}
Success.
Machine-readable output follows:
{
    "system_id": "mftwep",
    "resource_uri": "/MAAS/api/2.0/machines/mftwep/"
}
Success.
Machine-readable output follows:
{
    "resource_uri": "/MAAS/api/2.0/machines/dgx734/",
    "system_id": "dgx734"
}
Success.
Machine-readable output follows:
{
    "system_id": "7ygnk7",
    "resource_uri": "/MAAS/api/2.0/machines/7ygnk7/"
}
root@maas-dev:~# curl -s -k -u admin:admin -X GET https://10.3.0.1:8443/redfish/v1/Nodes
{
  "@odata.context" : "/redfish/v1/$metadata#Nodes",
  "@odata.id" : "/redfish/v1/Nodes",
  "@odata.type" : "#ComposedNodeCollection.ComposedNode...

Read more...

Changed in maas:
status: Triaged → Invalid
Changed in maasrsd:
status: Triaged → Invalid
Revision history for this message
Newell Jensen (newell-jensen) wrote :

Marking as invalid because this was not a clean testing environment. The signal registration in maasserver.models.signals.nodes was commented out from previous testing purposes. Once this was reverted and the regiond service was restarted, this was no longer an issue.

Changed in maas:
status: Invalid → New
Changed in maasrsd:
status: Invalid → New
Revision history for this message
Newell Jensen (newell-jensen) wrote :

This is not a bug but a new bug surfaced once this was tested with a clean testing environment. Please see bug #1667754 for details on the new bug.

Changed in maas:
status: New → Invalid
Changed in maasrsd:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.