# Error Message: replica scheduling failed

**URL:** <https://forums.suse.com/t/error-message-replica-scheduling-failed/43208>\
**Category:** SUSE Storage\
**Created:** [May 21, 2024, 4:51pm UTC](https://forums.suse.com/t/error-message-replica-scheduling-failed/43208 "2024-05-21T16:51:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonit](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/tonit/32/11222_2.png) [@tonit](https://forums.suse.com/u/tonit)\
**Post date:** [May 21, 2024, 4:51pm UTC](https://forums.suse.com/t/error-message-replica-scheduling-failed/43208/1 "2024-05-21T16:51:05Z")

</div>

Hello, I have a single-node k3s cluster installed on Azure VM. On the cluster I have installed Longhorn using kubectl. I have made a PersistentVolumeClaim and Deployment for Clickhouse but I guess this does not matter. Once I applied the k8s config, I bumped every time in this error shown on Longhorn UI:

```auto
Replica Scheduling Failure
Error Message: replica scheduling failed

```

In the logs of the longhorn manager pod I can see this message:  
`level=error msg="There's no available disk for replica pvc-cb754e28-d7dc-406a-8ddf-ad27f37d7ca4-r-201bab51, size 10737418240"`

Here is my k8s yaml file:

```auto
# PersistentVolumeClaim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: clickhouse-data
  namespace: observability
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: longhorn
---
# Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: clickhouse
  namespace: observability
spec:
  replicas: 1
  selector:
    matchLabels:
      app: clickhouse
  template:
    metadata:
      labels:
        app: clickhouse
    spec:
      volumes:
        - name: clickhouse-data
          persistentVolumeClaim:
            claimName: clickhouse-data
      containers:
      - name: clickhouse
        image: clickhouse/clickhouse-server
        ports:
        - containerPort: 8123
        - containerPort: 9000
        resources:
          limits:
            cpu: 600m
            memory: 4Gi
          requests:
            cpu: 300m
            memory: 2Gi
        volumeMounts:
            - name: clickhouse-data
              mountPath: /var/lib/clickhouse/data
              subPath: data

```

I would be happy to get some assistance cause I literally have no clue why this could happen. Thanks

---

<div class="post-metadata">

**Author:** ![shuo-wu](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/shuo-wu/32/6426_2.png) [@shuo-wu](https://forums.suse.com/u/shuo-wu)\
**Post date:** [May 21, 2024, 5:59pm UTC](https://forums.suse.com/t/error-message-replica-scheduling-failed/43208/2 "2024-05-21T17:59:07Z")

</div>

Notice that you are using a single-node cluster. I would recommend:

1. Change the field `numberOfReplicas` to 1 for the StorageClass. The default StorageClass is using value 3. You can change it by `kubectl -n longhorn-system edit cm longhorn-storageclass`
2. Check if there is at least one available disk on the UI - Node page

---

<div class="post-metadata">

**Author:** ![tonit](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/tonit/32/11222_2.png) [@tonit](https://forums.suse.com/u/tonit)\
**Post date:** [May 21, 2024, 10:26pm UTC](https://forums.suse.com/t/error-message-replica-scheduling-failed/43208/3 "2024-05-21T22:26:40Z")

</div>

Thanks for the quick response, this solved my issue
