2024-04-21 17:50:26 +00:00
|
|
|
// Package storagepool provides utilities and data structures in relation to storage pools.
|
|
|
|
// This library uses the libvirt and libvirtxml packages from libvirt.org to implement
|
|
|
|
// wrappers on top of the base library
|
2024-03-12 16:33:14 +00:00
|
|
|
package storagepool
|
2024-03-14 04:21:01 +00:00
|
|
|
|
2024-04-21 17:50:26 +00:00
|
|
|
import (
|
|
|
|
// log "git.staur.ca/stobbsm/simplelog"
|
|
|
|
// "github.com/gofrs/uuid/v5"
|
|
|
|
"libvirt.org/go/libvirt"
|
|
|
|
// "libvirt.org/go/libvirtxml"
|
|
|
|
)
|
2024-03-14 04:21:01 +00:00
|
|
|
|
|
|
|
var StoragePoolStateMap = map[libvirt.StoragePoolState]string{
|
2024-04-21 17:50:26 +00:00
|
|
|
libvirt.STORAGE_POOL_INACTIVE: "inactive",
|
|
|
|
libvirt.STORAGE_POOL_BUILDING: "building",
|
|
|
|
libvirt.STORAGE_POOL_RUNNING: "running",
|
|
|
|
libvirt.STORAGE_POOL_DEGRADED: "degraded",
|
2024-03-14 04:21:01 +00:00
|
|
|
libvirt.STORAGE_POOL_INACCESSIBLE: "inaccessible",
|
|
|
|
}
|
2024-03-19 15:13:44 +00:00
|
|
|
|
|
|
|
var Types = []string{
|
2024-04-21 17:50:26 +00:00
|
|
|
"dir",
|
|
|
|
"fs",
|
|
|
|
"netfs",
|
|
|
|
"disk",
|
|
|
|
"iscsi",
|
|
|
|
"logical",
|
|
|
|
"scsi",
|
|
|
|
"mpath",
|
|
|
|
"rbd",
|
|
|
|
"sheepdog",
|
|
|
|
"gluster",
|
|
|
|
"zfs",
|
|
|
|
"iscsi-direct",
|
2024-03-19 15:13:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var LocalTypes = []string{
|
2024-04-21 17:50:26 +00:00
|
|
|
"dir",
|
|
|
|
"fs",
|
|
|
|
"disk",
|
|
|
|
"logical",
|
|
|
|
"scsi",
|
|
|
|
"zfs",
|
2024-03-19 15:13:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var NetTypes = []string{
|
2024-04-21 17:50:26 +00:00
|
|
|
"netfs",
|
|
|
|
"iscsi",
|
|
|
|
"mpath",
|
|
|
|
"rbd",
|
|
|
|
"sheepdog",
|
|
|
|
"gluster",
|
|
|
|
"iscsi-direct",
|
2024-03-19 15:13:44 +00:00
|
|
|
}
|