как создать словарь со списком машин без повторений?

Есть словарь с списком ВМ, их нужно распределить по списку nodes = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0}, так что есть машина с именем aff создалась на цифре 1, то больше на 1-ом быть aff не должно. Т.е следующий aff уже будет на любой другой цифре node

import requests
import random
import json
import re

def check_language(current_hostname):
    if ('-java-' in current_hostname or '-go-' in current_hostname):
        return True
    return False

def check_os_version(current_os):
    current_os = vm['distribution']['description']
    if re.match(r"Debian 11", vm['distribution']['description']):
        return False
    return True

def get_next_hostname(current_hostname):
    parts = current_hostname.split('-')
    index = int(parts[-1].split('.')[0])
    new_name = '{}-{}-{}.node.eu.consul'.format(parts[0], parts[1], index + 6)
    return new_name

def get_service_name(current_hostname):
    parts = current_hostname.split('-')
    service_type = '{}'.format(parts[0])
    return service_type

response = requests.get('http://127.0.0.1/asl_real.json')
asl_vms = json.loads(response.text)

vm_to_create = {}
ready_for_nodes = {}
nodes = {1: 0, 2: 0, 3: 0, 4: 0, 5: 0}

for vm in asl_vms:
    if check_language(vm['name']) == True and check_os_version(vm['distribution']['description']) == True:
        fst_part = get_service_name(vm['name'])
        vm_res = {'1st_part_name:' : fst_part,'os:' : vm['distribution']['description'],'memory:' : vm['memory'],'cpu:' : vm['cpu'],'cpuNumber:' : vm['cpuNumber'],'disk:' : vm['disk']}
        for num in nodes:
            if fst_part in vm_res:
                continue
            else:
                new_vm_name = get_next_hostname(vm['name'])
                vm_to_create[new_vm_name] = vm_res
                ready_for_nodes[num] = vm_to_create

print(json.dumps(ready_for_nodes))

вывод программы: у меня сейчас пока все машины создаються на всех цифрах node, проверка по имени (чтобы пропускать повторяющиеся имена не работает) :(

{
  "1": {
    "aff-java-7.node.eu.consul": {
      "1st_part_name:": "aff",
      "os:": "Debian 10.1 x64",
      "memory:": 1536,
      "cpu:": 2,
      "cpuNumber:": 2,
      "disk:": 8192
    },
    "aff-java-9.node.eu.consul": {
      "1st_part_name:": "aff",
      "os:": "Debian 10.1 x64",
      "memory:": 1024,
      "cpu:": 2,
      "cpuNumber:": 2,
      "disk:": 8192
    },
    "tgbot-go-7.node.eu.consul": {
      "1st_part_name:": "tgbot",
      "os:": "Debian 10.1 x64",
      "memory:": 2048,
      "cpu:": 4,
      "cpuNumber:": 4,
      "disk:": 8192
    }
  },
  "2": {
    "aff-java-7.node.eu.consul": {
      "1st_part_name:": "aff",
      "os:": "Debian 10.1 x64",
      "memory:": 1536,
      "cpu:": 2,
      "cpuNumber:": 2,
      "disk:": 8192
    },
    "aff-java-9.node.eu.consul": {
      "1st_part_name:": "aff",
      "os:": "Debian 10.1 x64",
      "memory:": 1024,
      "cpu:": 2,
      "cpuNumber:": 2,
      "disk:": 8192
    },
    "tgbot-go-7.node.eu.consul": {
      "1st_part_name:": "tgbot",
      "os:": "Debian 10.1 x64",
      "memory:": 2048,
      "cpu:": 4,
      "cpuNumber:": 4,
      "disk:": 8192
    }
  }

Это возвращает апи, в целом там список машин, который последовательно я перебираю (проверки по языку написания, версии и тд)

{
      "id" : 803,
      "name" : "aff-java-4.node.eu.consul",
      "internalId" : "vm803",
      "tenantId" : 5,
      "memory" : 1024,
      "disk" : 8192,
      "cpu" : 2,
      "cpuNumber" : 2,
      "bandwidth" : 100,
      "tariffId" : 1,
      "ipAddresses" : [ ],
      "privateIpAddress" : "10.192.4.68",
      "state" : "VIR_DOMAIN_RUNNING",
      "timeAdded" : "2022-08-10T18:29:50+03:00",
      "backupPolicy" : {
        "quantity" : 1,
        "frequency" : 72
      },
      "distribution" : {
        "id" : 6,
        "name" : "DEBIAN",
        "description" : "Debian 11.1 x64",
        "bitness" : 64
      },
      "accessUsers" : [ "[email protected]", "[email protected]" ],
      "publicKeys" : [ {
        "id" : 3,
        "name" : "[email protected]",
        "type" : "ECDSA",
        "installed" : true
      }, {
        "id" : 1,
        "name" : "sc",
        "type" : "ECDSA",
        "installed" : true
      } ],
      "host" : "172.16.4.23",
      "nodeId" : 2
  },
  {
      "id" : 804,
      "name" : "tgbot-go-1.node.eu.consul",
      "internalId" : "vm804",
      "tenantId" : 5,
      "memory" : 2048,
      "disk" : 8192,
      "cpu" : 4,
      "cpuNumber" : 4,
      "bandwidth" : 100,
      "tariffId" : 1,
      "ipAddresses" : [ ],
      "privateIpAddress" : "10.192.4.68",
      "state" : "VIR_DOMAIN_RUNNING",
      "timeAdded" : "2022-08-10T18:29:50+03:00",
      "backupPolicy" : {
        "quantity" : 1,
        "frequency" : 72
      },
      "distribution" : {
        "id" : 6,
        "name" : "DEBIAN",
        "description" : "Debian 10.1 x64",
        "bitness" : 64
      },
      "accessUsers" : [ "[email protected]", "[email protected]" ],
      "publicKeys" : [ {
        "id" : 3,
        "name" : "[email protected]",
        "type" : "ECDSA",
        "installed" : true
      }, {
        "id" : 1,
        "name" : "sc",
        "type" : "ECDSA",
        "installed" : true
      } ],
      "host" : "172.16.4.23",
      "nodeId" : 4
  },

Ответы (0 шт):