fix(reinstall): use OSTemplate.vmid (not template_vmid) and convert memory bytes->MB
- AttributeError: OSTemplate has no 'template_vmid' field; the actual column is 'vmid'. - Use OSTemplate.get_vmid_for_node() to support cross-node replicated templates, falling back to source_node/vmid otherwise. - VMInstance.memory is stored in bytes, but Proxmox config expects MB.
This commit is contained in:
@@ -148,6 +148,14 @@ async def lifespan(app: FastAPI):
|
||||
except Exception as e:
|
||||
logger.error(f"Error running admin initialization: {e}")
|
||||
|
||||
# Register the main event loop for cross-thread WebSocket broadcasts
|
||||
try:
|
||||
import asyncio
|
||||
from .websocket_manager import set_main_loop
|
||||
set_main_loop(asyncio.get_event_loop())
|
||||
except Exception as e:
|
||||
logger.warning(f"Failed to register main event loop: {e}")
|
||||
|
||||
# Start background monitoring worker
|
||||
try:
|
||||
from .workers.monitoring_worker import start_monitoring_worker
|
||||
|
||||
Reference in New Issue
Block a user