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

« back to all changes in this revision

Viewing changes to nova/virt/xenapi/vm_utils.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, James Page
  • Date: 2013-03-20 12:59:22 UTC
  • mfrom: (1.1.69)
  • Revision ID: package-import@ubuntu.com-20130320125922-ohvfav96lemn9wlz
Tags: 1:2013.1~rc1-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/avoid_setuptools_git_dependency.patch: Refreshed.
* debian/control: Clean up dependencies:
  - Dropped python-gflags no longer needed.
  - Dropped python-daemon no longer needed.
  - Dropped python-glance no longer needed.
  - Dropped python-lockfile no longer needed.
  - Dropped python-simplejson no longer needed.
  - Dropped python-tempita no longer needed.
  - Dropped python-xattr no longer needed.
  - Add sqlite3 required for the testsuite.

[ James Page ]
* d/watch: Update uversionmangle to deal with upstream versioning
  changes, remove tarballs.openstack.org. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# Copyright (c) 2010 Citrix Systems, Inc.
4
4
# Copyright 2011 Piston Cloud Computing, Inc.
5
 
# Copyright 2012 OpenStack, LLC.
 
5
# Copyright 2012 OpenStack Foundation
6
6
#
7
7
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
8
8
#    not use this file except in compliance with the License. You may obtain
37
37
 
38
38
from nova.api.metadata import base as instance_metadata
39
39
from nova import block_device
 
40
from nova.compute import instance_types
40
41
from nova.compute import power_state
41
42
from nova.compute import task_states
42
43
from nova import exception
208
209
 
209
210
        3. Using hardware virtualization
210
211
    """
211
 
    instance_type = instance['instance_type']
 
212
    instance_type = instance_types.extract_instance_type(instance)
212
213
    mem = str(long(instance_type['memory_mb']) * 1024 * 1024)
213
214
    vcpus = str(instance_type['vcpus'])
214
215
 
321
322
 
322
323
 
323
324
def ensure_free_mem(session, instance):
324
 
    inst_type_id = instance['instance_type_id']
325
 
    instance_type = instance['instance_type']
 
325
    instance_type = instance_types.extract_instance_type(instance)
326
326
    mem = long(instance_type['memory_mb']) * 1024 * 1024
327
327
    host = session.get_xenapi_host()
328
328
    host_free_mem = long(session.call_xenapi("host.compute_free_memory",
1143
1143
 
1144
1144
    # FIXME(jk0): this was copied directly from compute.manager.py, let's
1145
1145
    # refactor this to a common area
1146
 
    instance_type = instance['instance_type']
 
1146
    instance_type = instance_types.extract_instance_type(instance)
1147
1147
    allowed_size_gb = instance_type['root_gb']
1148
1148
    allowed_size_bytes = allowed_size_gb * 1024 * 1024 * 1024
1149
1149