Exemplo n.º 1
0
    def configure(self, virtapi):
        # (dscannell) import the libvirt module to ensure that the the
        # libvirt flags can be read in.
        from nova.virt.libvirt.driver import LibvirtDriver

        self.determine_openstack_user()

        # Two libvirt drivers are created for the two different cases:
        #   migration: When doing a migration we attempt to keep everything
        #              the same as a regular boot. In this case we just use
        #              the regular driver without modifications.
        #
        #   launch:     When doing a launch we dealing exclusively with qcow2
        #               images. We need to replace the regular image backend
        #               with the LaunchImageBackend that will force exclusive
        #               use of qcow2.
        launch_libvirt_conn = LibvirtDriver(virtapi, read_only=False)
        launch_libvirt_conn.image_backend = LaunchImageBackend(CONF.use_cow_images)
        self.libvirt_connections = {'migration': LibvirtDriver(virtapi, read_only=False),
                                    'launch': launch_libvirt_conn}

        libvirt_uri = launch_libvirt_conn.uri()
        self.vmsapi.configure(
                vms_api.Vmsctl(vms_platform='libvirt',
                            management_options={'connection_url': libvirt_uri}))
Exemplo n.º 2
0
    def configure(self, virtapi):
        # (dscannell) import the libvirt module to ensure that the the
        # libvirt flags can be read in.
        from nova.virt.libvirt.driver import LibvirtDriver

        self.determine_openstack_user()

        # Two libvirt drivers are created for the two different cases:
        #   migration: When doing a migration we attempt to keep everything
        #              the same as a regular boot. In this case we just use
        #              the regular driver without modifications.
        #
        #   launch:     When doing a launch we dealing exclusively with qcow2
        #               images. We need to replace the regular image backend
        #               with the LaunchImageBackend that will force exclusive
        #               use of qcow2.
        launch_libvirt_conn = LibvirtDriver(virtapi, read_only=False)
        launch_libvirt_conn.image_backend = LaunchImageBackend(CONF.use_cow_images)
        self.libvirt_connections = {'migration': LibvirtDriver(virtapi, read_only=False),
                                    'launch': launch_libvirt_conn}

        vms_config = self.vmsapi.config()
        # It doesn't matter which libvirt connection we use because the uri
        # should be the same in either case.
        vms_config.MANAGEMENT['connection_url'] = launch_libvirt_conn.uri()
        self.vmsapi.select_hypervisor('libvirt')
Exemplo n.º 3
0
    def configure(self, virtapi):
        # (dscannell) import the libvirt module to ensure that the the
        # libvirt flags can be read in.
        from nova.virt.libvirt.driver import LibvirtDriver

        self.determine_openstack_user()

        # Two libvirt drivers are created for the two different cases:
        #   migration: When doing a migration we attempt to keep everything
        #              the same as a regular boot. In this case we just use
        #              the regular driver without modifications.
        #
        #   launch:     When doing a launch we dealing exclusively with qcow2
        #               images. We need to replace the regular image backend
        #               with the LaunchImageBackend that will force exclusive
        #               use of qcow2.
        launch_libvirt_conn = LibvirtDriver(virtapi, read_only=False)
        launch_libvirt_conn.image_backend = LaunchImageBackend(
            CONF.use_cow_images)
        self.libvirt_connections = {
            'migration': LibvirtDriver(virtapi, read_only=False),
            'launch': launch_libvirt_conn
        }

        libvirt_uri = launch_libvirt_conn.uri()
        self.vmsapi.configure(
            vms_api.Vmsctl(vms_platform='libvirt',
                           management_options={'connection_url': libvirt_uri}))