~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 09:04:58 UTC
  • mfrom: (1.1.66)
  • Revision ID: package-import@ubuntu.com-20121123090458-91565o7aev1i1h71
Tags: 2013.1~g1-0ubuntu1
[ Adam Gandelman ]
* debian/control: Ensure novaclient is upgraded with nova,
  require python-keystoneclient >= 1:2.9.0. (LP: #1073289)
* debian/patches/{ubuntu/*, rbd-security.patch}: Dropped, applied
  upstream.
* debian/control: Add python-testtools to Build-Depends.

[ Chuck Short ]
* New upstream version.
* Refreshed debian/patches/avoid_setuptools_git_dependency.patch.
* debian/rules: FTBFS if missing binaries.
* debian/nova-scheudler.install: Add missing rabbit-queues and
  nova-rpc-zmq-receiver.
* Remove nova-volume since it doesnt exist anymore, transition to cinder-*.
* debian/rules: install apport hook in the right place.
* debian/patches/ubuntu-show-tests.patch: Display test failures.
* debian/control: Add depends on genisoimage
* debian/control: Suggest guestmount.
* debian/control: Suggest websockify. (LP: #1076442)
* debian/nova.conf: Disable nova-volume service.
* debian/control: Depend on xen-system-* rather than the hypervisor.
* debian/control, debian/mans/nova-conductor.8, debian/nova-conductor.init,
  debian/nova-conductor.install, debian/nova-conductor.logrotate
  debian/nova-conductor.manpages, debian/nova-conductor.postrm
  debian/nova-conductor.upstart.in: Add nova-conductor service.
* debian/control: Add python-fixtures as a build deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 
2
 
 
3
# Copyright (c) 2012 NTT DOCOMO, INC.
 
4
# All Rights Reserved.
 
5
#
 
6
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 
7
#    not use this file except in compliance with the License. You may obtain
 
8
#    a copy of the License at
 
9
#
 
10
#         http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
#    Unless required by applicable law or agreed to in writing, software
 
13
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
14
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
15
#    License for the specific language governing permissions and limitations
 
16
#    under the License.
 
17
 
 
18
"""
 
19
SQLAlchemy models for baremetal data.
 
20
"""
 
21
 
 
22
from sqlalchemy.orm import relationship, backref, object_mapper
 
23
from sqlalchemy import Column, Integer, BigInteger, String, schema
 
24
from sqlalchemy import ForeignKey, DateTime, Boolean, Text, Float, Index
 
25
from sqlalchemy.exc import IntegrityError
 
26
from sqlalchemy.ext.declarative import declarative_base
 
27
from sqlalchemy.schema import ForeignKeyConstraint
 
28
 
 
29
from nova.db.sqlalchemy import models
 
30
 
 
31
 
 
32
BASE = declarative_base()
 
33
 
 
34
 
 
35
class BareMetalNode(BASE, models.NovaBase):
 
36
    """Represents a bare metal node."""
 
37
 
 
38
    __tablename__ = 'bm_nodes'
 
39
    id = Column(Integer, primary_key=True)
 
40
    service_host = Column(String(255))
 
41
    instance_uuid = Column(String(36), nullable=True)
 
42
    cpus = Column(Integer)
 
43
    memory_mb = Column(Integer)
 
44
    local_gb = Column(Integer)
 
45
    pm_address = Column(Text)
 
46
    pm_user = Column(Text)
 
47
    pm_password = Column(Text)
 
48
    prov_mac_address = Column(Text)
 
49
    registration_status = Column(String(16))
 
50
    task_state = Column(String(255))
 
51
    prov_vlan_id = Column(Integer)
 
52
    terminal_port = Column(Integer)
 
53
 
 
54
 
 
55
class BareMetalPxeIp(BASE, models.NovaBase):
 
56
    __tablename__ = 'bm_pxe_ips'
 
57
    id = Column(Integer, primary_key=True)
 
58
    address = Column(String(255), unique=True)
 
59
    server_address = Column(String(255), unique=True)
 
60
    bm_node_id = Column(Integer, ForeignKey('bm_nodes.id'), nullable=True)
 
61
 
 
62
 
 
63
class BareMetalInterface(BASE, models.NovaBase):
 
64
    __tablename__ = 'bm_interfaces'
 
65
    id = Column(Integer, primary_key=True)
 
66
    bm_node_id = Column(Integer, ForeignKey('bm_nodes.id'), nullable=True)
 
67
    address = Column(String(255), unique=True)
 
68
    datapath_id = Column(String(255))
 
69
    port_no = Column(Integer)
 
70
    vif_uuid = Column(String(36), unique=True)
 
71
 
 
72
 
 
73
class BareMetalDeployment(BASE, models.NovaBase):
 
74
    __tablename__ = 'bm_deployments'
 
75
    id = Column(Integer, primary_key=True)
 
76
    key = Column(String(255))
 
77
    image_path = Column(String(255))
 
78
    pxe_config_path = Column(String(255))
 
79
    root_mb = Column(Integer)
 
80
    swap_mb = Column(Integer)