Generate libvirt config files
This commit is contained in:
9
generate
9
generate
@ -17,6 +17,7 @@ import pprint
|
||||
import logging
|
||||
import ipaddress
|
||||
import re
|
||||
import hashlib
|
||||
|
||||
try:
|
||||
import argparse
|
||||
@ -156,8 +157,14 @@ def create_node(lab, node_id, node_type):
|
||||
offset = total_nodes
|
||||
total_nodes += nc
|
||||
|
||||
node_hostname = "%s%d-%d" % (node_type, lab["id"], node_id)
|
||||
hex_digest = hashlib.md5(node_hostname.encode('utf-8')).hexdigest()
|
||||
node_uuid = hex_digest[0:8] + '-'+ hex_digest[8:12] + '-' + hex_digest[12:16] + '-' + hex_digest[16:20] + '-' + hex_digest[20:]
|
||||
|
||||
ret = {
|
||||
"hostname": "%s%d-%d" % (node_type, lab["id"], node_id),
|
||||
"uuid": node_uuid,
|
||||
"type": node_type,
|
||||
"hostname": node_hostname,
|
||||
"id": node_id,
|
||||
"mgmt": {
|
||||
"ipv4": "%s/%s"
|
||||
|
Reference in New Issue
Block a user