code: def allocate(self):
          
          network_name = None
  
          self._hypervisor = libvirt.open(
              self.configuration.get('hypervisor', 'qemu:///system'))
  
          self._storage_pool = self._retrieve_pool()
  
          if 'network' in self.configuration:
              self._network = network.create(self._hypervisor, self.identifier,
                                             self.configuration['network'])
              network_name = self._network.name()
  
          disk_path = self._retrieve_disk_path()
  
          if self._storage_pool is not None:
              self._storage_pool.refresh()
  
          self._domain = domain_create(self._hypervisor, self.identifier,
                                       self.configuration['domain'],
                                       disk_path, network_name=network_name)
  
          if self._network is None:
              self._network = network.lookup(self._domain)
docs: Initializes libvirt resources.