diff --git a/api-daemon/pvcapid/flaskapi.py b/api-daemon/pvcapid/flaskapi.py index 38e16f82..e064107d 100755 --- a/api-daemon/pvcapid/flaskapi.py +++ b/api-daemon/pvcapid/flaskapi.py @@ -1002,7 +1002,7 @@ class API_VM_Root(Resource): type: string node_selector: type: string - description: The selector used to determine candidate nodes during migration + description: The selector used to determine candidate nodes during migration; see 'target_selector' in the node daemon configuration reference node_autostart: type: boolean description: Whether to autostart the VM when its node returns to ready domain state @@ -1297,7 +1297,7 @@ class API_VM_Root(Resource): name: selector type: string required: false - description: The selector used to determine candidate nodes during migration + description: The selector used to determine candidate nodes during migration; see 'target_selector' in the node daemon configuration reference default: none enum: - mem @@ -1446,7 +1446,7 @@ class API_VM_Element(Resource): name: selector type: string required: false - description: The selector used to determine candidate nodes during migration + description: The selector used to determine candidate nodes during migration; see 'target_selector' in the node daemon configuration reference default: none enum: - mem @@ -1629,7 +1629,7 @@ class API_VM_Metadata(Resource): type: string node_selector: type: string - description: The selector used to determine candidate nodes during migration + description: The selector used to determine candidate nodes during migration; see 'target_selector' in the node daemon configuration reference node_autostart: type: string description: Whether to autostart the VM when its node returns to ready domain state @@ -1678,7 +1678,7 @@ class API_VM_Metadata(Resource): name: selector type: string required: false - description: The selector used to determine candidate nodes during migration + description: The selector used to determine candidate nodes during migration; see 'target_selector' in the node daemon configuration reference enum: - mem - memfree diff --git a/client-cli/pvc/pvc.py b/client-cli/pvc/pvc.py index d6ff502f..a83f0374 100755 --- a/client-cli/pvc/pvc.py +++ b/client-cli/pvc/pvc.py @@ -803,7 +803,7 @@ def cli_vm(): ) @click.option( "-s", - "--selector", + "--node-selector", "node_selector", default="none", show_default=True, @@ -857,6 +857,18 @@ def vm_define( ): """ Define a new virtual machine from Libvirt XML configuration file VMCONFIG. + + The target node selector ("--node-selector"/"-s") can be "none" to use the cluster default, or one of the following values: + * "mem": choose the node with the least provisioned VM memory + * "memfree": choose the node with the most (real) free memory + * "vcpus": choose the node with the least allocated VM vCPUs + * "load": choose the node with the lowest current load average + * "vms": choose the node with the least number of provisioned VMs + + For most clusters, "mem" should be sufficient, but others may be used based on the cluster workload and available resources. The following caveats should be considered: + * "mem" looks at the provisioned memory, not the allocated memory; thus, stopped or disabled VMs are counted towards a node's memory for this selector, even though their memory is not actively in use. + * "memfree" looks at the free memory of the node in general, ignoring the amount provisioned to VMs; if any VM's internal memory usage changes, this value would be affected. This might be preferable to "mem" on clusters with very high memory utilization versus total capacity or if many VMs are stopped/disabled. + * "load" looks at the system load of the node in general, ignoring load in any particular VMs; if any VM's CPU usage changes, this value would be affected. This might be preferable on clusters with some very CPU intensive VMs. """ # Open the XML file @@ -898,7 +910,7 @@ def vm_define( ) @click.option( "-s", - "--selector", + "--node-selector", "node_selector", default=None, show_default=False, @@ -942,6 +954,8 @@ def vm_meta( ): """ Modify the PVC metadata of existing virtual machine DOMAIN. At least one option to update must be specified. DOMAIN may be a UUID or name. + + For details on the "--node-selector"/"-s" values, please see help for the command "pvc vm define". """ if ( @@ -4137,6 +4151,8 @@ def provisioner_template_system_add( ): """ Add a new system template NAME to the PVC cluster provisioner. + + For details on the possible "--node-selector" values, please see help for the command "pvc vm define". """ params = dict() params["name"] = name @@ -4230,6 +4246,8 @@ def provisioner_template_system_modify( ): """ Add a new system template NAME to the PVC cluster provisioner. + + For details on the possible "--node-selector" values, please see help for the command "pvc vm define". """ params = dict() params["vcpus"] = vcpus diff --git a/daemon-common/common.py b/daemon-common/common.py index 6b8aa6b0..0a2199ca 100644 --- a/daemon-common/common.py +++ b/daemon-common/common.py @@ -679,7 +679,7 @@ def getNodes(zkhandler, node_limit, dom_uuid): # -# via allocated memory +# via provisioned memory # def findTargetNodeMem(zkhandler, node_limit, dom_uuid): most_provfree = 0 diff --git a/docs/manuals/daemon.md b/docs/manuals/daemon.md index 79f30ea7..2e439a13 100644 --- a/docs/manuals/daemon.md +++ b/docs/manuals/daemon.md @@ -353,7 +353,19 @@ The password for the PVC node daemon to log in to the IPMI interface. * *required* -The selector algorithm to use when migrating hosts away from the node. Valid `selector` values are: `mem`: the node with the least allocated VM memory; `vcpus`: the node with the least allocated VM vCPUs; `load`: the node with the least current load average; `vms`: the node with the least number of provisioned VMs. +The default selector algorithm to use when migrating VMs away from a node; individual VMs can override this default. + +Valid `target_selector` values are: + * `mem`: choose the node with the least provisioned VM memory + * `memfree`: choose the node with the most (real) free memory + * `vcpus`: choose the node with the least allocated VM vCPUs + * `load`: choose the node with the lowest current load average + * `vms`: choose the node with the least number of provisioned VMs + +For most clusters, `mem` should be sufficient, but others may be used based on the cluster workload and available resources. The following caveats should be considered: + * `mem` looks at the provisioned memory, not the allocated memory; thus, stopped or disabled VMs are counted towards a node's memory for this selector, even though their memory is not actively in use. + * `memfree` looks at the free memory of the node in general, ignoring the amount provisioned to VMs; if any VM's internal memory usage changes, this value would be affected. This might be preferable to `mem` on clusters with very high memory utilization versus total capacity or if many VMs are stopped/disabled. + * `load` looks at the system load of the node in general, ignoring load in any particular VMs; if any VM's CPU usage changes, this value would be affected. This might be preferable on clusters with some very CPU intensive VMs. #### `system` → `configuration` → `directories` → `dynamic_directory` diff --git a/docs/manuals/swagger.json b/docs/manuals/swagger.json index f063598e..ed1fcf57 100644 --- a/docs/manuals/swagger.json +++ b/docs/manuals/swagger.json @@ -192,7 +192,7 @@ "type": "array" }, "node_selector": { - "description": "The selector used to determine candidate nodes during migration", + "description": "The selector used to determine candidate nodes during migration; see 'target_selector' in the node daemon configuration reference", "type": "string" } }, @@ -1414,7 +1414,7 @@ "type": "array" }, "node_selector": { - "description": "The selector used to determine candidate nodes during migration", + "description": "The selector used to determine candidate nodes during migration; see 'target_selector' in the node daemon configuration reference", "type": "string" }, "profile": { @@ -6174,7 +6174,7 @@ }, { "default": "none", - "description": "The selector used to determine candidate nodes during migration", + "description": "The selector used to determine candidate nodes during migration; see 'target_selector' in the node daemon configuration reference", "enum": [ "mem", "memfree", @@ -6333,7 +6333,7 @@ }, { "default": "none", - "description": "The selector used to determine candidate nodes during migration", + "description": "The selector used to determine candidate nodes during migration; see 'target_selector' in the node daemon configuration reference", "enum": [ "mem", "memfree", @@ -6594,7 +6594,7 @@ "type": "string" }, { - "description": "The selector used to determine candidate nodes during migration", + "description": "The selector used to determine candidate nodes during migration; see 'target_selector' in the node daemon configuration reference", "enum": [ "mem", "memfree",