def handoff_launch_vm(base_diskpath, base_mempath,
                      launch_disk, launch_memory,
                      launch_disk_size, launch_memory_size,
                      disk_overlay_map, memory_overlay_map):
    fuse = synthesis.run_fuse(
        Cloudlet_Const.CLOUDLETFS_PATH, Cloudlet_Const.CHUNK_SIZE,
        base_diskpath, launch_disk_size, base_mempath, launch_memory_size,
        resumed_disk=launch_disk,  disk_overlay_map=disk_overlay_map,
        resumed_memory=launch_memory, memory_overlay_map=memory_overlay_map
    )
    synthesized_vm = synthesis.SynthesizedVM(
        launch_disk, launch_memory, fuse,
        disk_only=False, qemu_args=None,
    )

    synthesized_vm.resume()
    synthesis.connect_vnc(synthesized_vm.machine)
    # terminate
    synthesized_vm.monitor.terminate()
    synthesized_vm.monitor.join()
    synthesized_vm.terminate()

    #import pdb;pdb.set_trace()
    #synthesized_vm.start()
    #synthesized_vm.join()

    return synthesized_vm
Ejemplo n.º 2
0
    def _handoff_launch_vm(self, libvirt_xml, base_diskpath, base_mempath,
                           launch_disk, launch_memory, launch_disk_size,
                           launch_memory_size, disk_overlay_map,
                           memory_overlay_map):
        # We told to FUSE that we have everything ready, so we need to wait
        # until delta_proc fininshes. we cannot start VM before delta_proc
        # finishes, because we don't know what will be modified in the future
        fuse = synthesis.run_fuse(Cloudlet_Const.CLOUDLETFS_PATH,
                                  Cloudlet_Const.CHUNK_SIZE,
                                  base_diskpath,
                                  launch_disk_size,
                                  base_mempath,
                                  launch_memory_size,
                                  resumed_disk=launch_disk,
                                  disk_overlay_map=disk_overlay_map,
                                  resumed_memory=launch_memory,
                                  memory_overlay_map=memory_overlay_map)
        synthesized_vm = synthesis.SynthesizedVM(launch_disk,
                                                 launch_memory,
                                                 fuse,
                                                 disk_only=False,
                                                 qemu_args=None,
                                                 nova_xml=libvirt_xml,
                                                 nova_conn=self._conn,
                                                 nova_util=libvirt_utils)

        synthesized_vm.resume()
        return synthesized_vm
Ejemplo n.º 3
0
def handoff_launch_vm(base_diskpath, base_mempath, launch_disk, launch_memory,
                      launch_disk_size, launch_memory_size, disk_overlay_map,
                      memory_overlay_map):
    fuse = synthesis.run_fuse(Cloudlet_Const.CLOUDLETFS_PATH,
                              Cloudlet_Const.CHUNK_SIZE,
                              base_diskpath,
                              launch_disk_size,
                              base_mempath,
                              launch_memory_size,
                              resumed_disk=launch_disk,
                              disk_overlay_map=disk_overlay_map,
                              resumed_memory=launch_memory,
                              memory_overlay_map=memory_overlay_map)
    synthesized_vm = synthesis.SynthesizedVM(
        launch_disk,
        launch_memory,
        fuse,
        disk_only=False,
        qemu_args=None,
    )

    synthesized_vm.resume()
    synthesis.connect_vnc(synthesized_vm.machine)
    # terminate
    synthesized_vm.monitor.terminate()
    synthesized_vm.monitor.join()
    synthesized_vm.terminate()

    #import pdb;pdb.set_trace()
    #synthesized_vm.start()
    #synthesized_vm.join()

    return synthesized_vm
Ejemplo n.º 4
0
def handoff_launch_vm(base_diskpath, base_mempath, launch_disk, launch_memory,
                      launch_disk_size, launch_memory_size, disk_overlay_map,
                      memory_overlay_map):
    # pull chunks out of the map
    disk_chunks = [
        int(chunk.split(':')[0]) for chunk in disk_overlay_map.split(',')
    ]
    mem_chunks = [
        int(chunk.split(':')[0]) for chunk in memory_overlay_map.split(',')
    ]
    valid_bit = int(disk_overlay_map.split(',', 1)[0].split(':')[1])

    fuse = synthesis.run_fuse(Cloudlet_Const.CLOUDLETFS_PATH,
                              Cloudlet_Const.CHUNK_SIZE,
                              base_diskpath,
                              launch_disk_size,
                              base_mempath,
                              launch_memory_size,
                              resumed_disk=launch_disk,
                              disk_chunks=disk_chunks,
                              resumed_memory=launch_memory,
                              memory_chunks=mem_chunks,
                              valid_bit=valid_bit)
    synthesized_vm = synthesis.SynthesizedVM(
        launch_disk,
        launch_memory,
        fuse,
        disk_only=False,
        qemu_args=None,
    )

    synthesized_vm.resume()
    synthesis.connect_vnc(synthesized_vm.machine)
    # terminate
    synthesized_vm.monitor.terminate()
    synthesized_vm.monitor.join()
    synthesized_vm.terminate()

    #import pdb;pdb.set_trace()
    #synthesized_vm.start()
    #synthesized_vm.join()

    return synthesized_vm
    def _handoff_launch_vm(
        self,
        libvirt_xml,
        base_diskpath,
        base_mempath,
        launch_disk,
        launch_memory,
        launch_disk_size,
        launch_memory_size,
        disk_overlay_map,
        memory_overlay_map,
    ):
        # We told to FUSE that we have everything ready, so we need to wait
        # until delta_proc fininshes. we cannot start VM before delta_proc
        # finishes, because we don't know what will be modified in the future
        fuse = synthesis.run_fuse(
            Cloudlet_Const.CLOUDLETFS_PATH,
            Cloudlet_Const.CHUNK_SIZE,
            base_diskpath,
            launch_disk_size,
            base_mempath,
            launch_memory_size,
            resumed_disk=launch_disk,
            disk_overlay_map=disk_overlay_map,
            resumed_memory=launch_memory,
            memory_overlay_map=memory_overlay_map,
        )
        synthesized_vm = synthesis.SynthesizedVM(
            launch_disk,
            launch_memory,
            fuse,
            disk_only=False,
            qemu_args=None,
            nova_xml=libvirt_xml,
            nova_conn=self._conn,
            nova_util=libvirt_utils,
        )

        synthesized_vm.resume()
        return synthesized_vm