diff --git a/internal/proxmox/networking.go b/internal/proxmox/networking.go index b0a6ef6..9e3d3bf 100644 --- a/internal/proxmox/networking.go +++ b/internal/proxmox/networking.go @@ -127,6 +127,18 @@ func (s *ProxmoxService) ConfigurePodRouter(podNumber int, node string, vmid int WANIPBase: s.Config.WANIPBase, } + // Skip if no agent is configured on the router + vmconfig, err := s.getVMConfig(node, vmid) + if err != nil{ + return fmt.Errorf("failed to detect router agent: %v", err) + } + if vmconfig.Agent == ""{ + log.Printf("No agent detected for VM %d, skipping config", vmid) + return nil + } + + log.Printf("Detected router agent for VM %d", vmid) + // Wait for router agent to be pingable statusReq := tools.ProxmoxAPIRequest{ Method: "POST", diff --git a/internal/proxmox/types.go b/internal/proxmox/types.go index 3cef3ff..cdfa6b2 100644 --- a/internal/proxmox/types.go +++ b/internal/proxmox/types.go @@ -115,6 +115,7 @@ type VirtualResourceConfig struct { Lock string `json:"lock"` Net0 string `json:"net0"` Net1 string `json:"net1,omitempty"` + Agent string `json:"agent"` } type VirtualResourceStatus struct {