~vila/byov/trunk

« back to all changes in this revision

Viewing changes to byov/vms/libvirt.py

  • Committer: Vincent Ladeuil
  • Date: 2018-01-30 09:47:07 UTC
  • Revision ID: v.ladeuil+lp@free.fr-20180130094707-yi9wfwnhlbg0jhia
Rename to byov.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This file is part of Online Services virtual machine tools.
 
1
# This file is part of Build Your Own Virtual machine.
2
2
#
3
3
# Copyright 2018 Vincent Ladeuil.
4
4
# Copyright 2016, 2017 Canonical Ltd.
24
24
except:
25
25
    from urllib import parse as urlparse
26
26
 
27
 
from olsvms import (
 
27
from byov import (
28
28
    errors,
29
29
    monitors,
30
30
    subprocesses,
298
298
        subprocesses.run(virt_install)
299
299
        self.scan_console_during_setup(console_size, virt_install)
300
300
        if self.conf.get('vm.ip') is None:
301
 
            raise errors.OlsVmsError('{} never received an IP'.format(
 
301
            raise errors.ByovError('{} never received an IP'.format(
302
302
                self.conf.get('vm.name')))
303
303
        self.wait_for_ssh()
304
304
        self.setup_over_ssh()
308
308
        console_size = monitors.actual_file_size(self.console_path())
309
309
        if console_size is None:
310
310
            # FIXME: This is needed because the following can fail (real life):
311
 
            # 'rm -f ~/vms/kvm1/console ; ./ols-vms start kvm1' because
 
311
            # 'rm -f ~/vms/kvm1/console ; ./byovm start kvm1' because
312
312
            # virsh start creates the console file as root if it doesn't exist
313
313
            self.empty_console()
314
314
            console_size = 0
315
315
        subprocesses.run(start_cmd)
316
316
        self.scan_console_during_start(console_size, start_cmd)
317
317
        if self.conf.get('vm.ip') is None:
318
 
            raise errors.OlsVmsError('{} never received an IP'.format(
 
318
            raise errors.ByovError('{} never received an IP'.format(
319
319
                self.conf.get('vm.name')))
320
320
        self.wait_for_ssh()
321
321
        self.save_existing_config()