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

« back to all changes in this revision

Viewing changes to nova/db/api.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:
44
44
"""
45
45
 
46
46
from nova import exception
47
 
from nova import flags
48
47
from nova.openstack.common import cfg
49
48
from nova import utils
50
49
 
59
58
    cfg.StrOpt('instance_name_template',
60
59
               default='instance-%08x',
61
60
               help='Template string to be used to generate instance names'),
62
 
    cfg.StrOpt('volume_name_template',
63
 
               default='volume-%s',
64
 
               help='Template string to be used to generate instance names'),
65
61
    cfg.StrOpt('snapshot_name_template',
66
62
               default='snapshot-%s',
67
63
               help='Template string to be used to generate snapshot names'),
68
64
    ]
69
65
 
70
 
FLAGS = flags.FLAGS
71
 
FLAGS.register_opts(db_opts)
 
66
CONF = cfg.CONF
 
67
CONF.register_opts(db_opts)
72
68
 
73
69
IMPL = utils.LazyPluggable('db_backend',
74
70
                           sqlalchemy='nova.db.sqlalchemy.api')
157
153
    return IMPL.service_get_all_compute_sorted(context)
158
154
 
159
155
 
160
 
def service_get_all_volume_sorted(context):
161
 
    """Get all volume services sorted by volume count.
162
 
 
163
 
    :returns: a list of (Service, volume_count) tuples.
164
 
 
165
 
    """
166
 
    return IMPL.service_get_all_volume_sorted(context)
167
 
 
168
 
 
169
156
def service_get_by_args(context, host, binary):
170
157
    """Get the state of a service by node name and binary."""
171
158
    return IMPL.service_get_by_args(context, host, binary)
417
404
            confirm_window, dest_compute)
418
405
 
419
406
 
 
407
def migration_get_in_progress_by_host(context, host):
 
408
    """Finds all migrations for the given host that are not yet confirmed or
 
409
    reverted.
 
410
    """
 
411
    return IMPL.migration_get_in_progress_by_host(context, host)
 
412
 
 
413
 
420
414
####################
421
415
 
422
416
 
477
471
    return IMPL.fixed_ip_get_by_address(context, address)
478
472
 
479
473
 
 
474
def fixed_ip_get_by_address_detailed(context, address):
 
475
    """Get detailed fixed ip info by address or raise if it does not exist."""
 
476
    return IMPL.fixed_ip_get_by_address_detailed(context, address)
 
477
 
 
478
 
480
479
def fixed_ip_get_by_instance(context, instance_uuid):
481
480
    """Get fixed ips by instance or raise if none exist."""
482
481
    return IMPL.fixed_ip_get_by_instance(context, instance_uuid)
492
491
    return IMPL.fixed_ips_by_virtual_interface(context, vif_id)
493
492
 
494
493
 
495
 
def fixed_ip_get_network(context, address):
496
 
    """Get a network for a fixed ip by address."""
497
 
    return IMPL.fixed_ip_get_network(context, address)
498
 
 
499
 
 
500
494
def fixed_ip_update(context, address, values):
501
495
    """Create a fixed ip from the values dictionary."""
502
496
    return IMPL.fixed_ip_update(context, address, values)
626
620
    return IMPL.instance_get_all_by_host(context, host)
627
621
 
628
622
 
 
623
def instance_get_all_by_host_and_node(context, host, node):
 
624
    """Get all instances belonging to a node."""
 
625
    return IMPL.instance_get_all_by_host_and_node(context, host, node)
 
626
 
 
627
 
629
628
def instance_get_all_by_host_and_not_type(context, host, type_id=None):
630
629
    """Get all instances belonging to a host with a different type_id."""
631
630
    return IMPL.instance_get_all_by_host_and_not_type(context, host, type_id)
641
640
    return IMPL.instance_get_floating_address(context, instance_id)
642
641
 
643
642
 
 
643
def instance_floating_address_get_all(context, instance_uuid):
 
644
    """Get all floating ip addresses of an instance"""
 
645
    return IMPL.instance_floating_address_get_all(context, instance_uuid)
 
646
 
 
647
 
644
648
def instance_get_all_hung_in_rebooting(context, reboot_window):
645
649
    """Get all instances stuck in a rebooting state."""
646
650
    return IMPL.instance_get_all_hung_in_rebooting(context, reboot_window)
743
747
    return IMPL.key_pair_destroy(context, user_id, name)
744
748
 
745
749
 
746
 
def key_pair_destroy_all_by_user(context, user_id):
747
 
    """Destroy all key_pairs by user."""
748
 
    return IMPL.key_pair_destroy_all_by_user(context, user_id)
749
 
 
750
 
 
751
750
def key_pair_get(context, user_id, name):
752
751
    """Get a key_pair or raise if it does not exist."""
753
752
    return IMPL.key_pair_get(context, user_id, name)
771
770
    return IMPL.network_associate(context, project_id, network_id, force)
772
771
 
773
772
 
774
 
def network_count(context):
775
 
    """Return the number of networks."""
776
 
    return IMPL.network_count(context)
777
 
 
778
 
 
779
773
def network_count_reserved_ips(context, network_id):
780
774
    """Return the number of reserved ips in the network."""
781
775
    return IMPL.network_count_reserved_ips(context, network_id)
800
794
    return IMPL.network_delete_safe(context, network_id)
801
795
 
802
796
 
803
 
def network_create_fixed_ips(context, network_id, num_vpn_clients):
804
 
    """Create the ips for the network, reserving sepecified ips."""
805
 
    return IMPL.network_create_fixed_ips(context, network_id, num_vpn_clients)
806
 
 
807
 
 
808
797
def network_disassociate(context, network_id):
809
798
    """Disassociate the network from project or raise if it does not exist."""
810
799
    return IMPL.network_disassociate(context, network_id)
865
854
    return IMPL.network_get_all_by_host(context, host)
866
855
 
867
856
 
868
 
def network_get_index(context, network_id):
869
 
    """Get non-conflicting index for network."""
870
 
    return IMPL.network_get_index(context, network_id)
871
 
 
872
 
 
873
 
def network_set_cidr(context, network_id, cidr):
874
 
    """Set the Classless Inner Domain Routing for the network."""
875
 
    return IMPL.network_set_cidr(context, network_id, cidr)
876
 
 
877
 
 
878
857
def network_set_host(context, network_id, host_id):
879
858
    """Safely set the host for network."""
880
859
    return IMPL.network_set_host(context, network_id, host_id)
931
910
    return IMPL.quota_update(context, project_id, resource, limit)
932
911
 
933
912
 
934
 
def quota_destroy(context, project_id, resource):
935
 
    """Destroy the quota or raise if it does not exist."""
936
 
    return IMPL.quota_destroy(context, project_id, resource)
937
 
 
938
 
 
939
913
###################
940
914
 
941
915
 
959
933
    return IMPL.quota_class_update(context, class_name, resource, limit)
960
934
 
961
935
 
962
 
def quota_class_destroy(context, class_name, resource):
963
 
    """Destroy the quota class or raise if it does not exist."""
964
 
    return IMPL.quota_class_destroy(context, class_name, resource)
965
 
 
966
 
 
967
 
def quota_class_destroy_all_by_name(context, class_name):
968
 
    """Destroy all quotas associated with a given quota class."""
969
 
    return IMPL.quota_class_destroy_all_by_name(context, class_name)
970
 
 
971
 
 
972
936
###################
973
937
 
974
938
 
975
 
def quota_usage_create(context, project_id, resource, in_use, reserved,
976
 
                       until_refresh):
977
 
    """Create a quota usage for the given project and resource."""
978
 
    return IMPL.quota_usage_create(context, project_id, resource,
979
 
                                   in_use, reserved, until_refresh)
980
 
 
981
 
 
982
939
def quota_usage_get(context, project_id, resource):
983
940
    """Retrieve a quota usage or raise if it does not exist."""
984
941
    return IMPL.quota_usage_get(context, project_id, resource)
989
946
    return IMPL.quota_usage_get_all_by_project(context, project_id)
990
947
 
991
948
 
992
 
def quota_usage_update(context, project_id, resource, in_use, reserved,
993
 
                       until_refresh):
 
949
def quota_usage_update(context, project_id, resource, **kwargs):
994
950
    """Update a quota usage or raise if it does not exist."""
995
 
    return IMPL.quota_usage_update(context, project_id, resource,
996
 
                                   in_use, reserved, until_refresh)
997
 
 
998
 
 
999
 
def quota_usage_destroy(context, project_id, resource):
1000
 
    """Destroy the quota usage or raise if it does not exist."""
1001
 
    return IMPL.quota_usage_destroy(context, project_id, resource)
 
951
    return IMPL.quota_usage_update(context, project_id, resource, **kwargs)
1002
952
 
1003
953
 
1004
954
###################
1016
966
    return IMPL.reservation_get(context, uuid)
1017
967
 
1018
968
 
1019
 
def reservation_get_all_by_project(context, project_id):
1020
 
    """Retrieve all reservations associated with a given project."""
1021
 
    return IMPL.reservation_get_all_by_project(context, project_id)
1022
 
 
1023
 
 
1024
969
def reservation_destroy(context, uuid):
1025
970
    """Destroy the reservation or raise if it does not exist."""
1026
971
    return IMPL.reservation_destroy(context, uuid)
1059
1004
###################
1060
1005
 
1061
1006
 
1062
 
def volume_allocate_iscsi_target(context, volume_id, host):
1063
 
    """Atomically allocate a free iscsi_target from the pool."""
1064
 
    return IMPL.volume_allocate_iscsi_target(context, volume_id, host)
1065
 
 
1066
 
 
1067
 
def volume_attached(context, volume_id, instance_id, mountpoint):
1068
 
    """Ensure that a volume is set as attached."""
1069
 
    return IMPL.volume_attached(context, volume_id, instance_id, mountpoint)
1070
 
 
1071
 
 
1072
 
def volume_create(context, values):
1073
 
    """Create a volume from the values dictionary."""
1074
 
    return IMPL.volume_create(context, values)
1075
 
 
1076
 
 
1077
 
def volume_data_get_for_project(context, project_id, session=None):
1078
 
    """Get (volume_count, gigabytes) for project."""
1079
 
    return IMPL.volume_data_get_for_project(context, project_id,
1080
 
                                            session=session)
1081
 
 
1082
 
 
1083
 
def volume_destroy(context, volume_id):
1084
 
    """Destroy the volume or raise if it does not exist."""
1085
 
    return IMPL.volume_destroy(context, volume_id)
1086
 
 
1087
 
 
1088
 
def volume_detached(context, volume_id):
1089
 
    """Ensure that a volume is set as detached."""
1090
 
    return IMPL.volume_detached(context, volume_id)
1091
 
 
1092
 
 
1093
 
def volume_get(context, volume_id):
1094
 
    """Get a volume or raise if it does not exist."""
1095
 
    return IMPL.volume_get(context, volume_id)
1096
 
 
1097
 
 
1098
 
def volume_get_all(context):
1099
 
    """Get all volumes."""
1100
 
    return IMPL.volume_get_all(context)
1101
 
 
1102
 
 
1103
 
def volume_get_all_by_host(context, host):
1104
 
    """Get all volumes belonging to a host."""
1105
 
    return IMPL.volume_get_all_by_host(context, host)
1106
 
 
1107
 
 
1108
 
def volume_get_all_by_instance_uuid(context, instance_uuid):
1109
 
    """Get all volumes belonging to an instance."""
1110
 
    return IMPL.volume_get_all_by_instance_uuid(context, instance_uuid)
1111
 
 
1112
 
 
1113
 
def volume_get_all_by_project(context, project_id):
1114
 
    """Get all volumes belonging to a project."""
1115
 
    return IMPL.volume_get_all_by_project(context, project_id)
1116
 
 
1117
 
 
1118
 
def volume_get_by_ec2_id(context, ec2_id):
1119
 
    """Get a volume by ec2 id."""
1120
 
    return IMPL.volume_get_by_ec2_id(context, ec2_id)
1121
 
 
1122
 
 
1123
1007
def volume_get_iscsi_target_num(context, volume_id):
1124
1008
    """Get the target num (tid) allocated to the volume."""
1125
1009
    return IMPL.volume_get_iscsi_target_num(context, volume_id)
1126
1010
 
1127
1011
 
1128
 
def volume_update(context, volume_id, values):
1129
 
    """Set the given properties on a volume and update it.
1130
 
 
1131
 
    Raises NotFound if volume does not exist.
1132
 
 
1133
 
    """
1134
 
    return IMPL.volume_update(context, volume_id, values)
1135
 
 
1136
 
 
1137
1012
def get_ec2_volume_id_by_uuid(context, volume_id):
1138
1013
    return IMPL.get_ec2_volume_id_by_uuid(context, volume_id)
1139
1014
 
1161
1036
####################
1162
1037
 
1163
1038
 
1164
 
def snapshot_create(context, values):
1165
 
    """Create a snapshot from the values dictionary."""
1166
 
    return IMPL.snapshot_create(context, values)
1167
 
 
1168
 
 
1169
 
def snapshot_destroy(context, snapshot_id):
1170
 
    """Destroy the snapshot or raise if it does not exist."""
1171
 
    return IMPL.snapshot_destroy(context, snapshot_id)
1172
 
 
1173
 
 
1174
 
def snapshot_get(context, snapshot_id):
1175
 
    """Get a snapshot or raise if it does not exist."""
1176
 
    return IMPL.snapshot_get(context, snapshot_id)
1177
 
 
1178
 
 
1179
 
def snapshot_get_all(context):
1180
 
    """Get all snapshots."""
1181
 
    return IMPL.snapshot_get_all(context)
1182
 
 
1183
 
 
1184
 
def snapshot_get_all_by_project(context, project_id):
1185
 
    """Get all snapshots belonging to a project."""
1186
 
    return IMPL.snapshot_get_all_by_project(context, project_id)
1187
 
 
1188
 
 
1189
 
def snapshot_get_all_for_volume(context, volume_id):
1190
 
    """Get all snapshots for a volume."""
1191
 
    return IMPL.snapshot_get_all_for_volume(context, volume_id)
1192
 
 
1193
 
 
1194
 
def snapshot_update(context, snapshot_id, values):
1195
 
    """Set the given properties on a snapshot and update it.
1196
 
 
1197
 
    Raises NotFound if snapshot does not exist.
1198
 
 
1199
 
    """
1200
 
    return IMPL.snapshot_update(context, snapshot_id, values)
1201
 
 
1202
 
 
1203
 
####################
1204
 
 
1205
 
 
1206
1039
def block_device_mapping_create(context, values):
1207
1040
    """Create an entry of block device mapping"""
1208
1041
    return IMPL.block_device_mapping_create(context, values)
1500
1333
    return IMPL.instance_system_metadata_get(context, instance_uuid)
1501
1334
 
1502
1335
 
1503
 
def instance_system_metadata_delete(context, instance_uuid, key):
1504
 
    """Delete the given system metadata item."""
1505
 
    IMPL.instance_system_metadata_delete(context, instance_uuid, key)
1506
 
 
1507
 
 
1508
1336
def instance_system_metadata_update(context, instance_uuid, metadata, delete):
1509
1337
    """Update metadata if it exists, otherwise create it."""
1510
1338
    IMPL.instance_system_metadata_update(
1543
1371
####################
1544
1372
 
1545
1373
 
 
1374
def bw_usage_get(context, uuid, start_period, mac):
 
1375
    """Return bw usage for instance and mac in a given audit period."""
 
1376
    return IMPL.bw_usage_get(context, uuid, start_period, mac)
 
1377
 
 
1378
 
1546
1379
def bw_usage_get_by_uuids(context, uuids, start_period):
1547
1380
    """Return bw usages for instance(s) in a given audit period."""
1548
1381
    return IMPL.bw_usage_get_by_uuids(context, uuids, start_period)
1549
1382
 
1550
1383
 
1551
1384
def bw_usage_update(context, uuid, mac, start_period, bw_in, bw_out,
1552
 
                    last_refreshed=None):
 
1385
                    last_ctr_in, last_ctr_out, last_refreshed=None):
1553
1386
    """Update cached bandwidth usage for an instance's network based on mac
1554
1387
    address.  Creates new record if needed.
1555
1388
    """
1556
1389
    return IMPL.bw_usage_update(context, uuid, mac, start_period, bw_in,
1557
 
            bw_out, last_refreshed=last_refreshed)
 
1390
            bw_out, last_ctr_in, last_ctr_out, last_refreshed=last_refreshed)
1558
1391
 
1559
1392
 
1560
1393
####################
1578
1411
                                                    extra_specs)
1579
1412
 
1580
1413
 
1581
 
##################
1582
 
 
1583
 
 
1584
 
def volume_metadata_get(context, volume_id):
1585
 
    """Get all metadata for a volume."""
1586
 
    return IMPL.volume_metadata_get(context, volume_id)
1587
 
 
1588
 
 
1589
 
def volume_metadata_delete(context, volume_id, key):
1590
 
    """Delete the given metadata item."""
1591
 
    IMPL.volume_metadata_delete(context, volume_id, key)
1592
 
 
1593
 
 
1594
 
def volume_metadata_update(context, volume_id, metadata, delete):
1595
 
    """Update metadata if it exists, otherwise create it."""
1596
 
    IMPL.volume_metadata_update(context, volume_id, metadata, delete)
1597
 
 
1598
 
 
1599
 
##################
1600
 
 
1601
 
 
1602
 
def volume_type_create(context, values):
1603
 
    """Create a new volume type."""
1604
 
    return IMPL.volume_type_create(context, values)
1605
 
 
1606
 
 
1607
 
def volume_type_get_all(context, inactive=False):
1608
 
    """Get all volume types."""
1609
 
    return IMPL.volume_type_get_all(context, inactive)
1610
 
 
1611
 
 
1612
 
def volume_type_get(context, id):
1613
 
    """Get volume type by id."""
1614
 
    return IMPL.volume_type_get(context, id)
1615
 
 
1616
 
 
1617
 
def volume_type_get_by_name(context, name):
1618
 
    """Get volume type by name."""
1619
 
    return IMPL.volume_type_get_by_name(context, name)
1620
 
 
1621
 
 
1622
 
def volume_type_destroy(context, name):
1623
 
    """Delete a volume type."""
1624
 
    return IMPL.volume_type_destroy(context, name)
1625
 
 
1626
 
 
1627
 
def volume_get_active_by_window(context, begin, end=None, project_id=None):
1628
 
    """Get all the volumes inside the window.
1629
 
 
1630
 
    Specifying a project_id will filter for a certain project."""
1631
 
    return IMPL.volume_get_active_by_window(context, begin, end, project_id)
1632
 
 
1633
 
 
1634
 
####################
1635
 
 
1636
 
 
1637
 
def volume_type_extra_specs_get(context, volume_type_id):
1638
 
    """Get all extra specs for a volume type."""
1639
 
    return IMPL.volume_type_extra_specs_get(context, volume_type_id)
1640
 
 
1641
 
 
1642
 
def volume_type_extra_specs_delete(context, volume_type_id, key):
1643
 
    """Delete the given extra specs item."""
1644
 
    IMPL.volume_type_extra_specs_delete(context, volume_type_id, key)
1645
 
 
1646
 
 
1647
 
def volume_type_extra_specs_update_or_create(context, volume_type_id,
1648
 
                                               extra_specs):
1649
 
    """Create or update volume type extra specs. This adds or modifies the
1650
 
    key/value pairs specified in the extra specs dict argument"""
1651
 
    IMPL.volume_type_extra_specs_update_or_create(context, volume_type_id,
1652
 
                                                    extra_specs)
1653
 
 
1654
 
 
1655
1414
###################
1656
1415
 
1657
1416
 
1673
1432
####################
1674
1433
 
1675
1434
 
1676
 
def sm_backend_conf_create(context, values):
1677
 
    """Create a new SM Backend Config entry."""
1678
 
    return IMPL.sm_backend_conf_create(context, values)
1679
 
 
1680
 
 
1681
 
def sm_backend_conf_update(context, sm_backend_conf_id, values):
1682
 
    """Update a SM Backend Config entry."""
1683
 
    return IMPL.sm_backend_conf_update(context, sm_backend_conf_id, values)
1684
 
 
1685
 
 
1686
 
def sm_backend_conf_delete(context, sm_backend_conf_id):
1687
 
    """Delete a SM Backend Config."""
1688
 
    return IMPL.sm_backend_conf_delete(context, sm_backend_conf_id)
1689
 
 
1690
 
 
1691
 
def sm_backend_conf_get(context, sm_backend_conf_id):
1692
 
    """Get a specific SM Backend Config."""
1693
 
    return IMPL.sm_backend_conf_get(context, sm_backend_conf_id)
1694
 
 
1695
 
 
1696
 
def sm_backend_conf_get_by_sr(context, sr_uuid):
1697
 
    """Get a specific SM Backend Config."""
1698
 
    return IMPL.sm_backend_conf_get_by_sr(context, sr_uuid)
1699
 
 
1700
 
 
1701
 
def sm_backend_conf_get_all(context):
1702
 
    """Get all SM Backend Configs."""
1703
 
    return IMPL.sm_backend_conf_get_all(context)
1704
 
 
1705
 
 
1706
 
####################
1707
 
 
1708
 
 
1709
 
def sm_flavor_create(context, values):
1710
 
    """Create a new SM Flavor entry."""
1711
 
    return IMPL.sm_flavor_create(context, values)
1712
 
 
1713
 
 
1714
 
def sm_flavor_update(context, sm_flavor_id, values):
1715
 
    """Update a SM Flavor entry."""
1716
 
    return IMPL.sm_flavor_update(context, sm_flavor_id, values)
1717
 
 
1718
 
 
1719
 
def sm_flavor_delete(context, sm_flavor_id):
1720
 
    """Delete a SM Flavor."""
1721
 
    return IMPL.sm_flavor_delete(context, sm_flavor_id)
1722
 
 
1723
 
 
1724
 
def sm_flavor_get(context, sm_flavor_id):
1725
 
    """Get a specific SM Flavor."""
1726
 
    return IMPL.sm_flavor_get(context, sm_flavor_id)
1727
 
 
1728
 
 
1729
 
def sm_flavor_get_all(context):
1730
 
    """Get all SM Flavors."""
1731
 
    return IMPL.sm_flavor_get_all(context)
1732
 
 
1733
 
 
1734
 
def sm_flavor_get_by_label(context, sm_flavor_label):
1735
 
    """Get a specific SM Flavor given label."""
1736
 
    return IMPL.sm_flavor_get_by_label(context, sm_flavor_label)
1737
 
 
1738
 
 
1739
 
####################
1740
 
 
1741
 
 
1742
 
def sm_volume_create(context, values):
1743
 
    """Create a new child Zone entry."""
1744
 
    return IMPL.sm_volume_create(context, values)
1745
 
 
1746
 
 
1747
 
def sm_volume_update(context, volume_id, values):
1748
 
    """Update a child Zone entry."""
1749
 
    return IMPL.sm_volume_update(context, values)
1750
 
 
1751
 
 
1752
 
def sm_volume_delete(context, volume_id):
1753
 
    """Delete a child Zone."""
1754
 
    return IMPL.sm_volume_delete(context, volume_id)
1755
 
 
1756
 
 
1757
 
def sm_volume_get(context, volume_id):
1758
 
    """Get a specific child Zone."""
1759
 
    return IMPL.sm_volume_get(context, volume_id)
1760
 
 
1761
 
 
1762
 
def sm_volume_get_all(context):
1763
 
    """Get all child Zones."""
1764
 
    return IMPL.sm_volume_get_all(context)
1765
 
 
1766
 
 
1767
 
####################
1768
 
 
1769
 
 
1770
1435
def aggregate_create(context, values, metadata=None):
1771
1436
    """Create a new aggregate with metadata."""
1772
1437
    return IMPL.aggregate_create(context, values, metadata)
1863
1528
    return IMPL.get_instance_uuid_by_ec2_id(context, ec2_id)
1864
1529
 
1865
1530
 
1866
 
def ec2_instance_create(context, instance_ec2_id):
 
1531
def ec2_instance_create(context, instance_uuid, id=None):
1867
1532
    """Create the ec2 id to instance uuid mapping on demand"""
1868
 
    return IMPL.ec2_instance_create(context, instance_ec2_id)
 
1533
    return IMPL.ec2_instance_create(context, instance_uuid, id)
1869
1534
 
1870
1535
 
1871
1536
####################