mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-22 11:13:26 +00:00
fix: add missing Type field when creating VMs/containers from cluster resources
addresses #329 - VMs were being displayed as LXC containers because the Type field wasn't being set when using the efficient cluster/resources polling method
This commit is contained in:
@@ -884,6 +884,14 @@ func (m *Monitor) pollVMsAndContainersEfficient(ctx context.Context, instanceNam
|
||||
for _, res := range resources {
|
||||
guestID := fmt.Sprintf("%s-%s-%d", instanceName, res.Node, res.VMID)
|
||||
|
||||
// Debug log the resource type
|
||||
log.Debug().
|
||||
Str("instance", instanceName).
|
||||
Str("name", res.Name).
|
||||
Int("vmid", res.VMID).
|
||||
Str("type", res.Type).
|
||||
Msg("Processing cluster resource")
|
||||
|
||||
// Calculate I/O rates
|
||||
currentMetrics := IOMetrics{
|
||||
DiskRead: int64(res.DiskRead),
|
||||
@@ -908,6 +916,7 @@ func (m *Monitor) pollVMsAndContainersEfficient(ctx context.Context, instanceNam
|
||||
Node: res.Node,
|
||||
Instance: instanceName,
|
||||
Status: res.Status,
|
||||
Type: "qemu",
|
||||
CPU: safeFloat(res.CPU),
|
||||
CPUs: res.MaxCPU,
|
||||
Memory: models.Memory{
|
||||
@@ -954,6 +963,7 @@ func (m *Monitor) pollVMsAndContainersEfficient(ctx context.Context, instanceNam
|
||||
Node: res.Node,
|
||||
Instance: instanceName,
|
||||
Status: res.Status,
|
||||
Type: "lxc",
|
||||
CPU: safeFloat(res.CPU),
|
||||
CPUs: int(res.MaxCPU),
|
||||
Memory: models.Memory{
|
||||
|
||||
Reference in New Issue
Block a user