def pre_start(self):
     virt_driver = self.cfg.get('nova', 'virt_driver')
     if virt_driver == virsh.VIRT_TYPE:
         virt_type = virsh.default(self.cfg.get('nova', 'libvirt_type'))
         LOG.info("Checking that your selected libvirt virtualization type [%s] is working and running." % (virt_type))
         if not virsh.virt_ok(virt_type, self.distro):
             msg = ("Libvirt type %s for distro %s does not seem to be active or configured correctly, "
                    "perhaps you should be using %s instead." % (virt_type, self.distro, virsh.DEFAULT_VIRT))
             raise exceptions.StartException(msg)
         virsh.restart(self.distro)
 def pre_start(self):
     # Let the parent class do its thing
     comp.PythonRuntime.pre_start(self)
     virt_driver = _canon_virt_driver(self.cfg.get('nova', 'virt_driver'))
     if virt_driver == virsh.VIRT_TYPE:
         virt_type = _canon_libvirt_type(self.cfg.get('nova', 'libvirt_type'))
         LOG.info("Checking that your selected libvirt virtualization type [%s] is working and running." % (virt_type))
         if not virsh.virt_ok(virt_type, self.distro):
             msg = ("Libvirt type %s for distro %s does not seem to be active or configured correctly, "
                    "perhaps you should be using %s instead." % (virt_type, self.distro, DEF_VIRT_TYPE))
             raise exceptions.StartException(msg)
         virsh.restart(self.distro)
Exemple #3
0
 def pre_start(self):
     # Let the parent class do its thing
     comp.PythonRuntime.pre_start(self)
     virt_driver = _canon_virt_driver(self.cfg.get('nova', 'virt_driver'))
     if virt_driver == 'libvirt':
         # FIXME: The configuration for the virtualization-type
         # should come from the persona.
         virt_type = _canon_libvirt_type(
             self.cfg.get('nova', 'libvirt_type'))
         LOG.info(
             "Checking that your selected libvirt virtualization type [%s] is working and running."
             % (virt_type))
         if not virsh.virt_ok(virt_type, self.distro):
             msg = (
                 "Libvirt type %s does not seem to be active or configured correctly, "
                 "perhaps you should be using %s instead." %
                 (virt_type, DEF_VIRT_TYPE))
             raise exceptions.StartException(msg)
         virsh.restart(self.distro)