def create_vm(self, server_id, device_map, nova):
        server = nova.servers.get(server_id)
        new_server_name = 'Restored_%s' % server.name
        flavor = nova.flavors.get(server.flavor.get('id'))

        new_server = nova.servers.create(new_server_name, None, flavor, block_device_mapping=device_map)

        logger.debug('About to create new vm instance %s', new_server.id)

        # TODO: ask about complete status
        while new_server.status == 'BUILD':
            time.sleep(5)
            new_server = nova.servers.get(new_server.id)

        logger.info('VM instance %s creation completed', new_server.id)

        return new_server.id
Create new vm instance using restored volumes
dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/iaas/backend.py/OpenStackBackend.create_vm