Exemple #1
0
 def shutdown(self, req):
     # execute xm shutdown req.vm_id
     shutdown = "xm shutdown " + str(req.vm_id)
     pexpect.run(shutdown)
     msg = Message.ShutdownRes(msg="Success",
                               hostname=req.node,
                               vm_id=req.vm_id)
     Client.sendonly_message(self.server.pm_relation.parent_addr)
Exemple #2
0
    def HypervisorReqHandler(self, request):
        print request
        
        if request.type == 'ubuntu':
            VM_initializer = VM_initializer_ubuntu(request.id, request.owner, request.group_num, request.vm_num, request.mem, request.disk, request.cores, request.hostmachine)
            VM_initializer.start()
        
        res = Message.NodeHypervisorRt(status = 'Success', msg = str(request.id) + '-' + request.owner, vm_id = request.id)
        print res.status
        print res.msg
        print request.id

        Client.sendonly_message(self.server.pm_relation.parent_addr,res)
Exemple #3
0
    def HypervisorReqHandler(self, request):
        print request

        if request.type == 'ubuntu':
            VM_initializer = VM_initializer_ubuntu(request.id, request.owner,
                                                   request.group_num,
                                                   request.vm_num, request.mem,
                                                   request.disk, request.cores,
                                                   request.hostmachine)
            VM_initializer.start()

        res = Message.NodeHypervisorRt(status='Success',
                                       msg=str(request.id) + '-' +
                                       request.owner,
                                       vm_id=request.id)
        print res.status
        print res.msg
        print request.id

        Client.sendonly_message(self.server.pm_relation.parent_addr, res)
Exemple #4
0
 def shutdown(self, req):
     # execute xm shutdown req.vm_id
     shutdown = "xm shutdown "+ str(req.vm_id)
     pexpect.run(shutdown)
     msg = Message.ShutdownRes(msg = "Success", hostname = req.node, vm_id = req.vm_id)
     Client.sendonly_message(self.server.pm_relation.parent_addr)