summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kearney <josh.kearney@rackspace.com>2010-12-20 11:31:21 -0600
committerJosh Kearney <josh.kearney@rackspace.com>2010-12-20 11:31:21 -0600
commit2eafa204703785f314226eeebb31a840d3dd502f (patch)
treed7bf7b76a43fca51a61bef87f91625df32b01e83
parent44fb3e77b89dd816ec8f753c9790b1fcb00e7b0c (diff)
downloadnova-2eafa204703785f314226eeebb31a840d3dd502f.tar.gz
nova-2eafa204703785f314226eeebb31a840d3dd502f.tar.xz
nova-2eafa204703785f314226eeebb31a840d3dd502f.zip
Added InstanceActions DB model
-rw-r--r--nova/db/sqlalchemy/models.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py
index 61764ee8d..6eac1b873 100644
--- a/nova/db/sqlalchemy/models.py
+++ b/nova/db/sqlalchemy/models.py
@@ -243,6 +243,17 @@ class InstanceDiagnostics(BASE, NovaBase):
vif_0_rx = Column(Float)
+class InstanceActions(BASE, NovaBase):
+ """Represents a guest VM's actions and results"""
+ __tablename__ = "instance_actions"
+ id = Column(Integer, primary_key=True)
+ instance_id = Column(Integer, ForeignKey('instances.id'))
+
+ action = Column(String(255))
+ result = Column(Boolean)
+ error = Column(Text)
+
+
class Volume(BASE, NovaBase):
"""Represents a block storage device that can be attached to a vm."""
__tablename__ = 'volumes'
@@ -543,10 +554,11 @@ def register_models():
it will never need to be called explicitly elsewhere.
"""
from sqlalchemy import create_engine
- models = (Service, Instance, InstanceDiagnostics, Volume, ExportDevice,
- IscsiTarget, FixedIp, FloatingIp, Network, SecurityGroup,
- SecurityGroupIngressRule, SecurityGroupInstanceAssociation,
- AuthToken, User, Project) # , Image, Host
+ models = (Service, Instance, InstanceDiagnostics, InstanceActions,
+ Volume, ExportDevice, IscsiTarget, FixedIp, FloatingIp,
+ Network, SecurityGroup, SecurityGroupIngressRule,
+ SecurityGroupInstanceAssociation, AuthToken, User,
+ Project) # , Image, Host
engine = create_engine(FLAGS.sql_connection, echo=False)
for model in models:
model.metadata.create_all(engine)