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}))
def configure(self): # (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() self.libvirt_conn = LibvirtDriver(False) vms_config = self.vmsapi.config() vms_config.MANAGEMENT['connection_url'] = self.libvirt_conn.uri self.vmsapi.select_hypervisor('libvirt')