~cbehrens/nova/rpc-kombu

« back to all changes in this revision

Viewing changes to nova/db/sqlalchemy/models.py

  • Committer: Mark Washenberger
  • Date: 2011-03-15 18:19:47 UTC
  • mfrom: (806 nova)
  • mto: This revision was merged to the branch mainline in revision 814.
  • Revision ID: mark.washenberger@rackspace.com-20110315181947-no5rfi12g7fa75sm
mergeĀ lp:nova

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
    availability_zone = Column(String(255), default='nova')
114
114
 
115
115
 
 
116
class ComputeNode(BASE, NovaBase):
 
117
    """Represents a running compute service on a host."""
 
118
 
 
119
    __tablename__ = 'compute_nodes'
 
120
    id = Column(Integer, primary_key=True)
 
121
    service_id = Column(Integer, ForeignKey('services.id'), nullable=True)
 
122
    service = relationship(Service,
 
123
                           backref=backref('compute_node'),
 
124
                           foreign_keys=service_id,
 
125
                           primaryjoin='and_('
 
126
                                'ComputeNode.service_id == Service.id,'
 
127
                                'ComputeNode.deleted == False)')
 
128
 
 
129
    vcpus = Column(Integer, nullable=True)
 
130
    memory_mb = Column(Integer, nullable=True)
 
131
    local_gb = Column(Integer, nullable=True)
 
132
    vcpus_used = Column(Integer, nullable=True)
 
133
    memory_mb_used = Column(Integer, nullable=True)
 
134
    local_gb_used = Column(Integer, nullable=True)
 
135
    hypervisor_type = Column(Text, nullable=True)
 
136
    hypervisor_version = Column(Integer, nullable=True)
 
137
 
 
138
    # Note(masumotok): Expected Strings example:
 
139
    #
 
140
    # '{"arch":"x86_64",
 
141
    #   "model":"Nehalem",
 
142
    #   "topology":{"sockets":1, "threads":2, "cores":3},
 
143
    #   "features":["tdtscp", "xtpr"]}'
 
144
    #
 
145
    # Points are "json translatable" and it must have all dictionary keys
 
146
    # above, since it is copied from <cpu> tag of getCapabilities()
 
147
    # (See libvirt.virtConnection).
 
148
    cpu_info = Column(Text, nullable=True)
 
149
 
 
150
 
116
151
class Certificate(BASE, NovaBase):
117
152
    """Represents a an x509 certificate"""
118
153
    __tablename__ = 'certificates'
191
226
    display_name = Column(String(255))
192
227
    display_description = Column(String(255))
193
228
 
 
229
    # To remember on which host a instance booted.
 
230
    # An instance may have moved to another host by live migraiton.
 
231
    launched_on = Column(Text)
194
232
    locked = Column(Boolean)
195
233
 
 
234
    os_type = Column(String(255))
 
235
 
196
236
    # TODO(vish): see Ewan's email about state improvements, probably
197
237
    #             should be in a driver base class or some such
198
238
    # vmstate_state = running, halted, suspended, paused