def _create_domain_setup_lxc(self, instance):
    inst_path = libvirt_utils.get_instance_path(instance)
    container_dir = os.path.join(inst_path, 'rootfs')
    fileutils.ensure_tree(container_dir)
    image = self.image_backend.image(instance, 'disk')
    rootfs_dev = disk.setup_container(image.path, container_dir=container_dir, use_cow=CONF.use_cow_images)
    try:
        if rootfs_dev:
            instance.system_metadata['rootfs_device_name'] = rootfs_dev
            instance.save()
    except Exception:
        with excutils.save_and_reraise_exception():
            self._create_domain_cleanup_lxc(instance)
def _create_domain_setup_lxc(self, instance):
    inst_path = libvirt_utils.get_instance_path(instance)
    container_dir = os.path.join(inst_path, 'rootfs')
    fileutils.ensure_tree(container_dir)
    image = self.image_backend.image(instance, 'disk')
    rootfs_dev = disk.setup_container(image.path, container_dir=container_dir, use_cow=CONF.use_cow_images)
    try:
        if rootfs_dev:
            instance.system_metadata['rootfs_device_name'] = rootfs_dev
            instance.save()
    except Exception:
        with excutils.save_and_reraise_exception():
            self._create_domain_cleanup_lxc(instance)