Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create a cluster on a PVE node with sufficient memory #71

Open
chengleqi opened this issue Jan 20, 2024 · 16 comments
Open

Unable to create a cluster on a PVE node with sufficient memory #71

chengleqi opened this issue Jan 20, 2024 · 16 comments
Labels
kind/bug Something isn't working question Further information is requested

Comments

@chengleqi
Copy link

chengleqi commented Jan 20, 2024

What steps did you take and what happened:

I followed the quickstart guide step by step, used the Proxmox VE builder to successfully create a PVE template, then configured ~/.cluster-api/clusterctl.yaml, and finally I used the following command to create the cluster:

clusterctl generate cluster proxmox-quickstart \
    --infrastructure proxmox \
    --kubernetes-version v1.27.8 \
    --control-plane-machine-count 1 \
    --worker-machine-count 3 > cluster.yaml

kubectl apply -f cluster.yaml

Then I received an error message:

E0120 05:46:40.670202       1 controller.go:324] "Reconciler error" err="failed to reconcile VM: cannot reserve 2147483648B of memory on node newpve: 0B available memory left" controller="proxmoxmachine" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="ProxmoxMachine" ProxmoxMachine="default/proxmox-quickstart-control-plane-gnjd5" namespace="default" name="proxmox-quickstart-control-plane-gnjd5" reconcileID="bd2f39b8-51fb-4cce-bd4d-429d596a8e31"

What did you expect to happen:
Successfully created the cluster.

Anything else you would like to add:
#36 (comment)

Environment:

  • Cluster-api-provider-proxmox version: 0.1.1
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release): Ubuntu 22.04
@chengleqi chengleqi added the kind/bug Something isn't working label Jan 20, 2024
@mcbenjemaa
Copy link
Member

Did you set the Variable MEMORY_MIB ?

@chengleqi
Copy link
Author

Did you set the Variable MEMORY_MIB ?

I tried setting the MEMORY_MIB variable as well as commenting out the MEMORY_MIB variable, and both methods resulted in an error with allocatable memory being 0.

@chengleqi
Copy link
Author

for _, vm := range vms {
		// Ignore VM Templates, as they can't be started.
		if vm.Template {
			continue
		}
		if reservableMemory < vm.MaxMem {
			reservableMemory = 0
		} else {
			reservableMemory -= vm.MaxMem
		}
	}

I think it should be an issue with the code above because there are already some virtual machines on my PVE node, and the total amount of memory set for these virtual machines has exceeded the total memory of the PVE node.

@mcbenjemaa
Copy link
Member

Try to add ProxmoxCluster.spec.schedulerHints.memoryAdjustment: 300
note that you can also disable scheduling by setting it to 0.

Please read more about this here node-over--underprovisioning

@chengleqi
Copy link
Author

Try to add ProxmoxCluster.spec.schedulerHints.memoryAdjustment: 300 note that you can also disable scheduling by setting it to 0.

Please read more about this here node-over--underprovisioning

Thank you, I'll take a look.

@chengleqi
Copy link
Author

chengleqi commented Jan 20, 2024

I added spec.schedulerHints to the ProxmoxCluster as follows:

apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: ProxmoxCluster
metadata:
  name: proxmox-quickstart
  namespace: default
spec:
  schedulerHints:
    memoryAdjustment: 0

But I got an error:

Error from server (BadRequest): error when creating "cluster.yaml": ProxmoxCluster in version "v1alpha1" cannot be handled as a ProxmoxCluster: strict decoding error: unknown field "spec.schedulerHints"`.

I found that the proxmoxclusters.infrastructure.cluster.x-k8s.io/v1alpha1 CRD installed with the command clusterctl init --infrastructure proxmox --ipam in-cluster --core cluster-api:v1.5.3 does not have the schedulerHints field, but the schedulerHints field is included in the project's config/crd/base/infrastructure.cluster.x-k8s.io_proxmoxclusters.yaml.

The configuration file called by clusterctl init --infrastructure proxmox --ipam in-cluster --core cluster-api:v1.5.3 is https://github.com/ionos-cloud/cluster-api-provider-proxmox/releases/latest/infrastructure-components.yaml, but the proxmoxclusters CRD in this file does not have the schedulerHints field. However, the proxmoxclusters CRD in the out/infrastructure-components.yaml file generated by make release-manifests includes the schedulerHints field. I suspect that the https://github.com/ionos-cloud/cluster-api-provider-proxmox/releases/latest/infrastructure-components.yaml file has not been updated. Could there be an issue with GitHub Actions CI Pipeline?

@mcbenjemaa
Copy link
Member

you're right, This feature is not yet released,
We will have the next release in the upcoming days.

@chengleqi
Copy link
Author

you're right, This feature is not yet released, We will have the next release in the upcoming days.

Thank you for your kind help, looking forward to the next release.

@mcbenjemaa
Copy link
Member

@mcbenjemaa
Copy link
Member

@chengleqi did it work for you

@EBMBA
Copy link

EBMBA commented Apr 21, 2024

Hi @mcbenjemaa,

I had the same error and I was able to fix it by upgrading to v0.2.0 and using this conf too :

I added spec.schedulerHints to the ProxmoxCluster as follows:

apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: ProxmoxCluster
metadata:
  name: proxmox-quickstart
  namespace: default
spec:
  schedulerHints:
    memoryAdjustment: 0

But I got an error:

Error from server (BadRequest): error when creating "cluster.yaml": ProxmoxCluster in version "v1alpha1" cannot be handled as a ProxmoxCluster: strict decoding error: unknown field "spec.schedulerHints"`.

I found that the proxmoxclusters.infrastructure.cluster.x-k8s.io/v1alpha1 CRD installed with the command clusterctl init --infrastructure proxmox --ipam in-cluster --core cluster-api:v1.5.3 does not have the schedulerHints field, but the schedulerHints field is included in the project's config/crd/base/infrastructure.cluster.x-k8s.io_proxmoxclusters.yaml.

The configuration file called by clusterctl init --infrastructure proxmox --ipam in-cluster --core cluster-api:v1.5.3 is https://github.com/ionos-cloud/cluster-api-provider-proxmox/releases/latest/infrastructure-components.yaml, but the proxmoxclusters CRD in this file does not have the schedulerHints field. However, the proxmoxclusters CRD in the out/infrastructure-components.yaml file generated by make release-manifests includes the schedulerHints field. I suspect that the https://github.com/ionos-cloud/cluster-api-provider-proxmox/releases/latest/infrastructure-components.yaml file has not been updated. Could there be an issue with GitHub Actions CI Pipeline?

Thanks 👌

@mcbenjemaa
Copy link
Member

You should upgrade to latest version,
And it will work.

@mcbenjemaa
Copy link
Member

Try

clusterctl init --ipam in-cluster --infrastructure proxmox:v0.4.0

Or v0.3.0

Both should work.

@wikkyk
Copy link
Collaborator

wikkyk commented Apr 22, 2024

Is this still an issue with v0.4.0?

@wikkyk wikkyk added the question Further information is requested label Apr 22, 2024
@pasettifabio
Copy link

Hu @wikkyk ,
I've got v0.4.0 and I need to add the schedulerHints to the ProxmoxCluster specs manually:

generated:

  - lastTransitionTime: "2024-05-25T07:33:11Z"
    reason: WaitingForNodeRef
    severity: Info
    status: "False"
    type: NodeHealthy
  failureMessage: 'Failure detected from referenced resource infrastructure.cluster.x-k8s.io/v1alpha1,
    Kind=ProxmoxMachine with name "proxmox-quickstart-control-plane-t9hjg": cannot
    reserve 8438939648B of memory on node host01: 0B available memory left'
  failureReason: InsufficientResources
  lastUpdated: "2024-05-25T07:33:12Z"
  observedGeneration: 2
  phase: Failed

Adding manually:

apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: ProxmoxCluster
metadata:
  name: proxmox-quickstart
  namespace: default
spec:
  schedulerHints:
    memoryAdjustment: 0

Result:

  - lastTransitionTime: "2024-05-25T07:39:59Z"
    reason: WaitingForNodeRef
    severity: Info
    status: "False"
    type: NodeHealthy

@wikkyk
Copy link
Collaborator

wikkyk commented Jun 10, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants