Commit 686bd605 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Add QuotaHolderSerial column to VM and Network

Correlate the VirtualMachine and Network models with a QuotaHolderSerial
entry, holding the serial number returned by the QuotaHolder for the
last allocation for these resources.
parent d2668593
......@@ -288,6 +288,8 @@ class VirtualMachine(models.Model):
deleted = models.BooleanField('Deleted', default=False, db_index=True)
suspended = models.BooleanField('Administratively Suspended',
default=False)
serial = models.ForeignKey(QuotaHolderSerial,
related_name='virtual_machine', null=True)
# VM State
# The following fields are volatile data, in the sense
......@@ -460,6 +462,8 @@ class Network(models.Model):
reserved_map='',
size=0),
null=True)
serial = models.ForeignKey(QuotaHolderSerial, related_name='network',
null=True)
objects = ForUpdateManager()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment