id(UUID, PK)email(unique)username(unique, nullable)passwordHashstatus(ACTIVE,SUSPENDED,INVITED)lastLoginAtcreatedAt,updatedAt
Indices:
UNIQUE(email)UNIQUE(username)INDEX(status, createdAt)
id(UUID, PK)name(unique:admin,operator,viewer)descriptionisSystem
id(UUID, PK)code(unique, ej:vm.start,user.create)resourceaction
id(UUID, PK)userId(FK -> User)roleId(FK -> Role)scopeType(GLOBAL|GROUP)scopeId(nullable)
Indice:
UNIQUE(userId, roleId, scopeType, scopeId)
roleId(FK -> Role)permissionId(FK -> Permission)
Indice:
UNIQUE(roleId, permissionId)
id(UUID, PK)name(unique)slug(unique)description
id(UUID, PK)groupId(FK -> Group)userId(FK -> User)joinedAt
Indice:
UNIQUE(groupId, userId)
id(UUID, PK)name(unique)providerType(MOCK,LIBVIRT)connectionUri(ej:qemu:///system)status(ONLINE,OFFLINE,MAINTENANCE)cpuCoresTotalmemoryMbTotalstorageGbTotallastHeartbeatAt
Indices:
UNIQUE(name)INDEX(status, lastHeartbeatAt)
id(UUID, PK)nameexternalId(id en provider)state(PROVISIONING,STOPPED,RUNNING,STARTING,STOPPING,REBOOTING,ERROR,DELETING)vcpumemoryMbgroupId(FK -> Group)hostId(FK -> HypervisorHost)templateId(FK -> Template, nullable)createdById(FK -> User)createdAt,updatedAt
Indices:
UNIQUE(hostId, externalId)UNIQUE(groupId, name)INDEX(state, hostId)
id(UUID, PK)nametype(BRIDGE,NAT,VLAN)cidrgatewayIpgroupId(FK -> Group)hostId(FK -> HypervisorHost, nullable)
Indice:
UNIQUE(groupId, name)
id(UUID, PK)vmId(FK -> VirtualMachine)networkId(FK -> Network)name(ej:eth0)macAddress(unique)ipAddress(nullable)isPrimary
id(UUID, PK)nametype(DIR,LVM,NFS,ZFS)capacityGbusedGbstatus(READY,DEGRADED,OFFLINE)hostId(FK -> HypervisorHost)
Indice:
UNIQUE(hostId, name)
id(UUID, PK)nameexternalIdsizeGbformat(QCOW2,RAW)storagePoolId(FK -> StoragePool)vmId(FK -> VirtualMachine, nullable)isBoot
Indice:
UNIQUE(storagePoolId, externalId)
id(UUID, PK)nameversionosFamilychecksumSha256(unique)sizeBytesstoragePoolId(FK -> StoragePool)pathuploadedById(FK -> User)
id(UUID, PK)nameversionsourceType(ISO|VM)isoId(FK -> IsoImage, nullable)baseVmId(FK -> VirtualMachine, nullable)defaultVcpudefaultMemoryMbcloudInit(jsonb, nullable)
Indice:
UNIQUE(name, version)
id(UUID, PK)userId(FK -> User)refreshTokenHash(unique)accessTokenJti(unique)ipuserAgentexpiresAtrevokedAt(nullable)
id(UUID, PK)actorUserId(FK -> User, nullable)action(ej:vm.create,auth.login)resourceType(ej:VM,USER)resourceIdmetadata(jsonb)ipcreatedAt
Indices:
INDEX(createdAt DESC)INDEX(actorUserId, createdAt DESC)INDEX(resourceType, resourceId, createdAt DESC)
- User M:N Role (UserRole)
- Role M:N Permission (RolePermission)
- User M:N Group (GroupMember)
- Group 1:N VirtualMachine
- HypervisorHost 1:N VirtualMachine
- HypervisorHost 1:N StoragePool
- StoragePool 1:N DiskVolume / IsoImage
- VirtualMachine M:N Network (VmNetworkInterface)
- User 1:N Session / AuditLog