Comment 16 for bug 2048399

Revision history for this message
Alan Baghumian (alanbach) wrote :

I encountered this exact same issue with MAAS 3.3.5:

$ maas ${PROFILE} vm-host read 175
Success.
Machine-readable output follows:
{
    "version": "5.20",
    "cpu_over_commit_ratio": 1.0,
    "default_macvlan_mode": null,
    "type": "lxd",
    "architectures": [
        "amd64/generic"
    ],
    "capabilities": [
        "composable",
        "dynamic_local_storage",
        "over_commit",
        "storage_pools"
    ],
    "pool": {
        "name": "default",
        "description": "Default pool",
        "id": 0,
        "resource_uri": "/MAAS/api/2.0/resourcepool/0/"
    },
    "host": {
        "system_id": "mht63q",
        "__incomplete__": true
    },
    "id": 175,
    "total": {
        "cores": 0,
        "memory": 0,
        "local_storage": 234622992384
    },
    "name": "os-node-1",
    "available": {
        "cores": 0,
        "memory": 0,
        "local_storage": 234622992384
    },
    "zone": {
        "name": "default",
        "description": "",
        "id": 1,
        "resource_uri": "/MAAS/api/2.0/zones/default/"
    },
    "memory_over_commit_ratio": 1.0,
    "used": {
        "cores": 0,
        "memory": 0,
        "local_storage": 0
    },
    "tags": [
        "pod-console-logging"
    ],
    "storage_pools": [
        {
            "id": "default",
            "name": "default",
            "type": "dir",
            "path": "Unknown",
            "total": 234622992384,
            "used": 0,
            "available": 234622992384,
            "default": true
        }
    ],
    "resource_uri": "/MAAS/api/2.0/vm-hosts/175/"
}

Here is a quick workaround until this is fixed:

1. Find the affected LXD host ID either from the MAAS UI URL or CLI

$ maas ${PROFILE} vm-hosts read

2. SSH to the controller housing the PostgresSQL and login to DB (For reference only - your DB name is different):

$ sudo -u postgres psql maasdb

3. Update the cores and memory data for the LXD host based on what your hardware has (Running the CLI command after this will show the updated resources):

maasdb=# select * from maasserver_bmc where id=<LXD-host-ID>;

maasdb=# update maasserver_bmc set cores=64,memory=51200 where id=<LXD-host-ID>;
UPDATE 1

4. Compose a VM using MAAS CLI, only specify the VM name:

$ maas ${PROFILE} vm-hosts compose <LXD-host-ID> vm-name

5. Check the MAAS UI and wait for the initial commissioning to finish.

6. SSH to the LXD host to modify the resources (limits.cpu, limits.memory, disk etc):

$ sudo lxc config edit vm-name

7. Recommission the machine to reflect the hardware changes.