Пример #1
0
    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
    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
    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
    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)