• OpenStack配置虚拟机vcpu绑定步骤 转至元数据结尾


    1. Changed in compute node:
    
    给宿主机预留资源:
    
    宿主机可用cpu:cpuid 0 – cpuid 5
    
    宿主机可用内存:25G
    
    
    #vim /etc/nova/nova.conf
    vcpu_pin_set=6-31
    reserved_host_memory_mb=25600
    
    #grubby --update-kernel=ALL --args="isolcpus=6-31"
    #reboot
    
     
    
     
    
    2. Changed in controller node:
    
    给nova-scheduler服务添加两个过滤器,以过滤带有vcpu绑定的计算节点出来,给用户使用。
    
    这里的过滤是根据flavor的metadata中的aggregate_instance_extra_specs:pinned是true还是false,
    
    来判断用户是否需要给云主机做vcpu绑定。
    
    
    #vim /etc/nova/nova.conf
    scheduler_default_filters=...,NUMATopologyFilter,AggregateInstanceExtraSpecsFilter
    #systemctl restart openstack-nova-scheduler
    
     
    
     
    
    3. Configure aggregate:
    
    创建两个机组,分别为不给云主机绑定vcpu的normal机组,和给云主机绑定vcpu的performance机组。
    
    并添加计算节点到各个机组中。10-0-192-21为normal机组host,10-0-192-20为performance机组。
    
    # nova aggregate-create performance
    # nova aggregate-create normal
    
    # nova aggregate-list
    +----+-------------+-------------------+
    | Id | Name | Availability Zone |
    +----+-------------+-------------------+
    | 6 | performance | - |
    | 9 | normal | - |
    +----+-------------+-------------------+
    
    # nova aggregate-set-metadata 6 pinned=true
    # nova aggregate-set-metadata 9 pinned=false
    
    # nova aggregate-add-host 9 10-0-192-21
    Host 10-0-192-21 has been successfully added for aggregate 9
    +----+--------+-------------------+---------------+----------------+
    | Id | Name | Availability Zone | Hosts | Metadata |
    +----+--------+-------------------+---------------+----------------+
    | 9 | normal | - | '10-0-192-21' | 'pinned=false' |
    +----+--------+-------------------+---------------+----------------+
    # nova aggregate-add-host 6 10-0-192-20
    Host 10-0-192-20 has been successfully added for aggregate 6
    +----+-------------+-------------------+---------------+---------------+
    | Id | Name | Availability Zone | Hosts | Metadata |
    +----+-------------+-------------------+---------------+---------------+
    | 6 | performance | - | '10-0-192-20' | 'pinned=true' |
    +----+-------------+-------------------+---------------+---------------+
    
     
    
     
    
    4. Configure flavor:
    Add metadata 'aggregate type: normal' to old flavor:
    
    将已经存在的flavor的metadata的机组vcpu绑定属性设置为不绑定:
    #for FLAVOR in ` nova flavor-list | cut -f 2 -d ' ' | grep [0-9]* | grep -v "--" | grep -v ID`; do nova flavor-key ${FLAVOR} set "aggregate_instance_extra_specs:pinned"="false"; done
    
    
    Create new flavor with metadata 'aggregate type: performance':
    
    创建新的flavor, 带有的metadata中vcpu绑定属性设置为绑定:
    #nova flavor-create m1.big-1.vcpuPin 10 8192 20 4
    #nova flavor-create m1.small.vcpuPin 11 4096 20 2
    
    ... ...
    #for i in `nova flavor-list | grep vcpuPin | awk '{print $2}'`; do nova flavor-key $i set hw:cpu_policy=dedicated; nova flavor-key $i set aggregate_instance_extra_specs:pinned=true; done
    
    
    Launch an instance to test the new flavor, check if the instance runs in host whose aggegate type is performance:
    
    启动一个虚拟机,使用新创建的flavor,验证虚拟机是否运行在了10-0-192-20服务器上,检查虚拟机的xml配置信息是否包含vcpu绑定配置:
    #nova boot --image ...
    
    Attention:
    1. if flavor's metadata is NULL, then the vm may be scheduled to this pin=true host。
    
    如果flavor的metadata为空, 即创建flavor的时候,不指定metadata的机组绑定属性,则使用这个flavor的云主机可以像没配置vcpu绑定的时候那样, 运行在normal不绑定vcpu节点,或
    
    performance绑定vcpu节点。
  • 相关阅读:
    表表达式,Substring, CharIndex, 多行数据变同一行的用法
    武汉三首,记录备忘,写的不好,以后再改
    竟然又有两年没有码字发帖了,真是快长草了,打磨一下,克服拖延症,重新回归,重新写起!
    屈指一算,竟然有一年半没有发帖了,真是时光荏苒,白云苍狗!
    下雨有感
    (ETW) Event Trace for Windows 提高 (含pdf下载)
    (ETW) Event Tracing for Windows 入门 (含pdf下载)
    Requirejs加载超时问题的一个解决方法:设置waitSeconds=0
    如何通过Socket TCP发送并接收一个文件?
    Microsoft.VisualBasic.DateAndTime.Timer 与 DateTime.Now.TimeOfDay.TotalSeconds 相当
  • 原文地址:https://www.cnblogs.com/gushiren/p/9591068.html
Copyright © 2020-2023  润新知