mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 06:20:11 +01:00
feat(provision): try volume creation on all the nodes
Currently controller picks one node and the node agent keeps on trying to create the volume on that node. There might not be enough space available on that node to create the volume. The controller can try on all the nodes sequentially and fail the request if volume creation fails on all the nodes which satisfies the topology contraints. Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
8cc56377bd
commit
04f7635b6f
8 changed files with 128 additions and 80 deletions
|
|
@ -95,7 +95,9 @@ func (c *ZVController) syncZV(zv *apis.ZFSVolume) error {
|
|||
err = zfs.CreateVolume(zv)
|
||||
}
|
||||
if err == nil {
|
||||
err = zfs.UpdateZvolInfo(zv)
|
||||
err = zfs.UpdateZvolInfo(zv, zfs.ZFSStatusReady)
|
||||
} else {
|
||||
err = zfs.UpdateZvolInfo(zv, zfs.ZFSStatusFailed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -132,7 +134,8 @@ func (c *ZVController) updateZV(oldObj, newObj interface{}) {
|
|||
|
||||
oldZV, _ := oldObj.(*apis.ZFSVolume)
|
||||
if zfs.PropertyChanged(oldZV, newZV) ||
|
||||
c.isDeletionCandidate(newZV) {
|
||||
c.isDeletionCandidate(newZV) ||
|
||||
newZV.Status.State == zfs.ZFSStatusPending {
|
||||
klog.Infof("Got update event for ZV %s/%s", newZV.Spec.PoolName, newZV.Name)
|
||||
c.enqueueZV(newZV)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue