from pyVim.connect import SmartConnect, Disconnect
# Own modules
-from .common import pp
+from .common import pp, to_str
from .errors import FunctionNotImplementedError, PpError
from .config import CrTplConfiguration
-__version__ = '0.6.3'
+__version__ = '0.6.4'
LOG = logging.getLogger(__name__)
TZ = pytz.timezone('Europe/Berlin')
created_opt.value = int(time.time())
extra_opts.append(created_opt)
+ # Set waiting for 3 second in BIOS before booting
+ boot_opts = vim.vm.BootOptions()
+ boot_opts.bootDelay = 3000
+ boot_opts.bootRetryEnabled = False
+ boot_opts.enterBIOSSetup = False
+
config = vim.vm.ConfigSpec(
name=self.config.template_vm, deviceChange=dev_changes,
flags=vm_flags, extraConfig=extra_opts,
memoryMB=self.config.ram_mb, memoryHotAddEnabled=True,
numCPUs=self.config.num_cpus, cpuHotAddEnabled=True, cpuHotRemoveEnabled=True,
files=vm_file_info,
- guestId = 'oracleLinux64Guest',
- version = 'vmx-11',
+ guestId='oracleLinux64Guest',
+ version='vmx-11',
+ bootOptions=boot_opts,
#guestFullName='Oracle Enterprise Linux 7 (64 Bit)',
#alternateGuestName='OEL 7/64',
)
cur_time = time.time()
cur_duration = cur_time - self.ts_start_install
if (cur_time - last_dot) >= self.interval_dot:
- print('.', end='', flush=True)
- i += 1
- if i >= 60:
- print('', flush=True)
- print(' ', end='', flush=True)
- i = 0
- last_dot = cur_time
+ if self.verbose < 3:
+ print('.', end='', flush=True)
+ i += 1
+ if i >= 60:
+ print('', flush=True)
+ print(' ', end='', flush=True)
+ i = 0
+ last_dot = cur_time
- if self.verbose > 2:
+ if self.verbose > 3:
LOG.debug("Trying to connect to {a} via TCP port {p} ...".format(
a=sockaddr[0], p=sockaddr[1]))
except socket.error as e:
sock.close()
sock = None
- if self.verbose > 2:
+ if self.verbose > 3:
LOG.debug("Could not connect: {}".format(e))
continue