@@ -815,6 +815,12 @@ def generate_random_string(length):
length -= 1
return str
+def generate_random_id():
+ """
+ Return a random string suitable for use as a qemu id.
+ """
+ return "id" + generate_random_string(6)
+
def generate_tmp_file_name(file, ext=None, dir='/tmp/'):
"""
@@ -119,7 +119,7 @@ class VM:
self.address_cache = address_cache
self.netdev_id = []
for nic in params.get("nics").split():
- self.netdev_id.append(kvm_utils.generate_random_string(4))
+ self.netdev_id.append(kvm_utils.generate_random_id())
# Find a unique identifier for this VM
while True: