OpenStack status

commands

Command "resource" matches:
resource class create resource class delete resource class list resource class show resource provider aggregate list resource provider aggregate set resource provider allocation delete resource provider allocation set resource provider allocation show resource provider create resource provider delete resource provider inventory class set resource provider inventory delete resource provider inventory list resource provider inventory set resource provider inventory show resource provider list resource provider set resource provider show resource provider usage show
  • source_admin, use the Maximum in Pike

    1
    2
    3
    4
    
    export OS_AUTH_TYPE=password
    export OS_IDENTITY_API_VERSION=3
    export OS_COMPUTE_API_VERSION=2.53
    alias openstack='openstack --os-placement-api-version 1.10'
    
  • openstack hypervisor list

    ID Hypervisor Hostname Hypervisor Type Host IP State
    382f3758-a71d-4c62-8d86-ca2d800dbe0a u1604d-1 QEMU 10.103.3.61 up
    e2e21003-3df7-48d3-8d81-03570d9826f8 u1604d-2 QEMU 10.103.3.62 up
  • openstack server create --flavor m1.tiny --image cirros-0.3.5-x86_64-disk test2

  • openstack server delete test2

  • openstack resource provider usage show ea580606-2f51-4eeb-83fb-64b7bca41d47

    resource_class usage
    VCPU 2
    MEMORY_MB 1024
    DISK_GB 2
  • openstack resource provider inventory list e2e21003-3df7-48d3-8d81-03570d9826f8

    resource_class allocation_ratio max_unit reserved step_size min_unit total
    VCPU 16.0 4 0 1 1 4
    MEMORY_MB 1.5 7977 512 1 1 7977
    DISK_GB 1.0 159 0 1 1 159

Unit test

  • Commands

    1
    2
    
    python -m testtools.run -v nova.tests.unit.compute.test_resource_tracker.TestInitComputeNode
    tox -e py27 -- TestInitComputeNode
    

Documents

Placement

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Have to match '^CUSTOM\\_[A-Z0-9_]+$'
openstack resource class create CUSTOM_CACHE

openstack resource provider inventory class set \
  --total 10 --min_unit 1 --step_size 1 --reserved 0 --max_unit 10 --allocation_ratio 1.0 \
  84bcefa4-a838-4d73-bd3f-2f7f7e0688b7 CUSTOM_CACHE

#############################

openstack resource class create CUSTOM_CACHE_GUARANTEE_CPU_0
openstack resource class create CUSTOM_CACHE_GUARANTEE_CPU_1
openstack resource class create CUSTOM_CACHE_SHARED_CPU_0
openstack resource class create CUSTOM_CACHE_SHARED_CPU_1

openstack resource provider inventory set \
  --total 6 --min_unit 1 --step_size 1 --reserved 0 --max_unit 6 --allocation_ratio 1.0 \
  1a747270-2506-4b80-8e63-366ae7f6abb4 CUSTOM_CACHE_GUARANTEE_CPU_0

1a747270-2506-4b80-8e63-366ae7f6abb4 CUSTOM_CACHE_GUARANTEE_CPU_1
1a747270-2506-4b80-8e63-366ae7f6abb4 CUSTOM_CACHE_SHARED_CPU_0
1a747270-2506-4b80-8e63-366ae7f6abb4 CUSTOM_CACHE_SHARED_CPU_1

Log

  • delete vm

    1
    2
    3
    4
    
    10.101.5.9 - - [05/Jul/2018 14:21:19] "DELETE /allocations/f6a67296-0854-4939-95ef-1d3c7d0bfa84 HTTP/1.1" 204 0
    
    DEBUG nova.api.openstack.placement.handlers.allocation [req-f78c8fa4-8116-4013-b569-f0eae28a34c1 req-947652c7-f7d8-4e84-8d54-c3950d39df1d service placement] Successfully deleted allocations AllocationList[Allocation(consumer_id=1f7e8380-a644-41e7-b7f4-bbd1e50f0f49,created_at=<?>,id=<?>,project_id='bd90ee38d54b4c5c88a32a8799995871',resource_class='MEMORY_MB',resource_provider=ResourceProvider(ea580606-2f51-4eeb-83fb-64b7bca41d47),updated_at=<?>,used=512,user_id='c993a511daec4678813e158e57eb7772'), Allocation(consumer_id=1f7e8380-a644-41e7-b7f4-bbd1e50f0f49,created_at=<?>,id=<?>,project_id='bd90ee38d54b4c5c88a32a8799995871',resource_class='VCPU',resource_provider=ResourceProvider(ea580606-2f51-4eeb-83fb-64b7bca41d47),updated_at=<?>,used=1,user_id='c993a511daec4678813e158e57eb7772'), Allocation(consumer_id=1f7e8380-a644-41e7-b7f4-bbd1e50f0f49,created_at=<?>,id=<?>,project_id='bd90ee38d54b4c5c88a32a8799995871',resource_class='DISK_GB',resource_provider=ResourceProvider(ea580606-2f51-4eeb-83fb-64b7bca41d47),updated_at=<?>,used=1,user_id='c993a511daec4678813e158e57eb7772')]
    INFO nova.api.openstack.placement.requestlog [req-f78c8fa4-8116-4013-b569-f0eae28a34c1 req-947652c7-f7d8-4e84-8d54-c3950d39df1d service placement] 10.101.5.9 "DELETE /allocations/1f7e8380-a644-41e7-b7f4-bbd1e50f0f49" status: 204 len: 0 microversion: 1.0
    
  • create vm

>>>>> _get_by_requests req: suffix = request = RequestGroup(use_same_provider=False, resources={DISK_GB:1, MEMORY_MB:512, VCPU:1}, traits=[], aggregates=[]) <class 'nova.api.openstack.placement.lib.RequestGroup'> candidates = {'': ([AllocationRequest(anchor_root_provider_uuid=ea580606-2f51-4eeb-83fb-64b7bca41d47,resource_requests=[AllocationRequestResource,AllocationRequestResource,AllocationRequestResource],use_same_provider=False)], [ProviderSummary(resource_provider=ResourceProvider(ea580606-2f51-4eeb-83fb-64b7bca41d47),resources=[ProviderSummaryResource,ProviderSummaryResource,ProviderSummaryResource],traits=[])])} alloc_request_objs = [AllocationRequest(anchor_root_provider_uuid=ea580606-2f51-4eeb-83fb-64b7bca41d47,resource_requests=[AllocationRequestResource,AllocationRequestResource,AllocationRequestResource],use_same_provider=<?>)] summary_objs = [ProviderSummary(resource_provider=ResourceProvider(ea580606-2f51-4eeb-83fb-64b7bca41d47),resources=[ProviderSummaryResource,ProviderSummaryResource,ProviderSummaryResource],traits=[])] >>>>> alloc_request_objs <type 'list'> AllocationRequest(anchor_root_provider_uuid=ea580606-2f51-4eeb-83fb-64b7bca41d47,resource_requests=[AllocationRequestResource,AllocationRequestResource,AllocationRequestResource],use_same_provider=<?>) <class 'nova.api.openstack.placement.objects.resource_provider.AllocationRequest'> kept_summary_objs <type 'list'> ProviderSummary(resource_provider=ResourceProvider(ea580606-2f51-4eeb-83fb-64b7bca41d47),resources=[ProviderSummaryResource,ProviderSummaryResource,ProviderSummaryResource],traits=[]) <class 'nova.api.openstack.placement.objects.resource_provider.ProviderSummary'> <<<<< 10.101.5.9 - - [05/Jul/2018 14:19:37] "GET /allocation_candidates?resources=DISK_GB%3A1%2CMEMORY_MB%3A512%2CVCPU%3A1&limit=1000 HTTP/1.1" 200 364 10.101.5.9 - - [05/Jul/2018 14:19:37] "GET /allocations/f6a67296-0854-4939-95ef-1d3c7d0bfa84 HTTP/1.1" 200 19 10.101.5.9 - - [05/Jul/2018 14:19:37] "PUT /allocations/f6a67296-0854-4939-95ef-1d3c7d0bfa84 HTTP/1.1" 204 0 10.101.5.9 - - [05/Jul/2018 14:19:38] "GET /resource_providers?in_tree=ea580606-2f51-4eeb-83fb-64b7bca41d47 HTTP/1.1" 200 801 10.101.5.9 - - [05/Jul/2018 14:19:38] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/inventories HTTP/1.1" 200 397 10.101.5.9 - - [05/Jul/2018 14:19:38] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/aggregates HTTP/1.1" 200 18 10.101.5.9 - - [05/Jul/2018 14:19:38] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/traits HTTP/1.1" 200 49 10.101.5.9 - - [05/Jul/2018 14:19:38] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/inventories HTTP/1.1" 200 397 10.101.5.9 - - [05/Jul/2018 14:19:38] "GET /resource_providers?in_tree=ea580606-2f51-4eeb-83fb-64b7bca41d47 HTTP/1.1" 200 801 10.101.5.9 - - [05/Jul/2018 14:19:38] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/inventories HTTP/1.1" 200 397 10.101.5.9 - - [05/Jul/2018 14:19:38] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/aggregates HTTP/1.1" 200 18 10.101.5.9 - - [05/Jul/2018 14:19:39] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/traits HTTP/1.1" 200 49 10.101.5.9 - - [05/Jul/2018 14:19:39] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/inventories HTTP/1.1" 200 397 10.101.5.9 - - [05/Jul/2018 14:19:39] "GET /allocations/f6a67296-0854-4939-95ef-1d3c7d0bfa84 HTTP/1.1" 200 134

127.0.0.1 - - [04/Jul/2018 15:21:12] "GET /allocation_candidates?resources=DISK_GB%3A1%2CMEMORY_MB%3A512%2CVCPU%3A1&limit=1000 HTTP/1.1" 200 362 127.0.0.1 - - [04/Jul/2018 15:21:12] "GET /allocations/8be75f4f-be05-477b-99e7-3fdb24b33009 HTTP/1.1" 200 19 127.0.0.1 - - [04/Jul/2018 15:21:13] "PUT /allocations/8be75f4f-be05-477b-99e7-3fdb24b33009 HTTP/1.1" 204 0 127.0.0.1 - - [04/Jul/2018 15:21:13] "GET /resource_providers?in_tree=ea580606-2f51-4eeb-83fb-64b7bca41d47 HTTP/1.1" 200 801 127.0.0.1 - - [04/Jul/2018 15:21:13] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/inventories HTTP/1.1" 200 397 127.0.0.1 - - [04/Jul/2018 15:21:13] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/aggregates HTTP/1.1" 200 18 127.0.0.1 - - [04/Jul/2018 15:21:13] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/traits HTTP/1.1" 200 49 127.0.0.1 - - [04/Jul/2018 15:21:13] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/inventories HTTP/1.1" 200 397 127.0.0.1 - - [04/Jul/2018 15:21:13] "GET /resource_providers?in_tree=ea580606-2f51-4eeb-83fb-64b7bca41d47 HTTP/1.1" 200 801 127.0.0.1 - - [04/Jul/2018 15:21:13] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/inventories HTTP/1.1" 200 397 127.0.0.1 - - [04/Jul/2018 15:21:13] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/aggregates HTTP/1.1" 200 18 127.0.0.1 - - [04/Jul/2018 15:21:13] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/traits HTTP/1.1" 200 49 127.0.0.1 - - [04/Jul/2018 15:21:13] "GET /resource_providers/ea580606-2f51-4eeb-83fb-64b7bca41d47/inventories HTTP/1.1" 200 397 127.0.0.1 - - [04/Jul/2018 15:21:19] "GET /allocations/8be75f4f-be05-477b-99e7-3fdb24b33009 HTTP/1.1" 200 134

class AllocationCandidates(base.VersionedObject):
"""The AllocationCandidates object is a collection of possible allocations that match some request for resources, along with some summary information about the resource providers involved in these allocation candidates. """
comments powered by Disqus