예제 #1
0
파일: xencluster.py 프로젝트: maddingue/cxm
    def search_vm_started(self, vmname):
        """Search where the specified vm hostname is running.

		Return a list of Node where the VM is running.
		"""
        started = list()
        for node in self.get_nodes():
            if node.is_vm_started(vmname):
                started.append(node)

        return started
예제 #2
0
파일: xencluster.py 프로젝트: maddingue/cxm
    def search_vm_started(self, vmname):
        """Search where the specified vm hostname is running.

		Return a list of Node where the VM is running.
		"""
        started = list()
        for node in self.get_nodes():
            if node.is_vm_started(vmname):
                started.append(node)

        return started
예제 #3
0
파일: xencluster.py 프로젝트: maddingue/cxm
    def activate_vm(self, selected_node, vmname):
        """Activate all the LVM logicals volumes of the specified VM exclusively on the selected node.

		selected_node - (Node) Node where to activate the LVs
		vmname - (String) hostname of the vm

		Raise a ClusterNodeError if the VM is running.
		"""
        for node in self.get_nodes():
            if node.is_vm_started(vmname):
                raise ClusterNodeError(node.get_hostname(), ClusterNodeError.VM_RUNNING, vmname)
            else:
                node.deactivate_lv(vmname)

        selected_node.activate_lv(vmname)
예제 #4
0
파일: xencluster.py 프로젝트: maddingue/cxm
    def activate_vm(self, selected_node, vmname):
        """Activate all the LVM logicals volumes of the specified VM exclusively on the selected node.

		selected_node - (Node) Node where to activate the LVs
		vmname - (String) hostname of the vm

		Raise a ClusterNodeError if the VM is running.
		"""
        for node in self.get_nodes():
            if node.is_vm_started(vmname):
                raise ClusterNodeError(node.get_hostname(),
                                       ClusterNodeError.VM_RUNNING, vmname)
            else:
                node.deactivate_lv(vmname)

        selected_node.activate_lv(vmname)