Troubleshooting: `volume pvc-xxx not scheduled`
| October 22, 2020
All Longhorn versions.
When creating a Pod with Longhorn Volume as PVC, the Pod cannot start.
When checking for error message using kubectl describe <pod>
, the following message is shown:
Warning FailedAttachVolume 4m29s (x3 over 5m33s) attachdetach-controller AttachVolume.Attach failed for volume "pvc-xxx" : rpc error: code = Internal desc = Bad response statusCode [500]. Status [500 Internal Server Error]. Body: [message=unable to attach volume pvc-xxx to node-xxx: volume pvc-xxx not scheduled, code=Server Error, detail=] from [http://longhorn-backend:9500/v1/volumes/pvc-xxx?action=attach]
Noticed the message returned by Longhorn in the error above:
unable to attach volume pvc-xxx to node-xxx: volume pvc-xxx not scheduled
This is caused by Longhorn cannot find enough spaces on different nodes to store the data for the volume, which result in the volume scheduling failure.
For Longhorn v1.0.x, the default Longhorn installation has following settings:
Node Level Soft Anti-affinity: false
.longhorn
's Replica count is set to 3
.That means Longhorn will always try to allocate enough space on three different nodes for three replicas.
If this requirement cannot be satisfied, e.g. due to there are less than 3 nodes in the cluster, the volume scheduling will fail.
If this is the case, you can:
Node Level Soft Anti-affinity
to true
.1
or 2
.See scheduling section in the Longhorn doc for a detail description of the scheduling policy.
Starting Longhorn v1.1.0, we will introduce a new setting Allow Volume Creation With Degraded Availability
(true
by default) to help with the use case on smaller cluster.
See https://github.com/longhorn/longhorn/issues/1701 for details.
Recent articles
Troubleshooting: NoExecute taint prevents workloads from terminating© 2019-2024 Longhorn Authors | Documentation Distributed under CC-BY-4.0
© 2024 The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.