. Changed in compute node:

给宿主机预留资源:

宿主机可用cpu:cpuid  – cpuid 

宿主机可用内存:25G

#vim /etc/nova/nova.conf
vcpu_pin_set=-
reserved_host_memory_mb= #grubby --update-kernel=ALL --args="isolcpus=6-31"
#reboot . 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 . Configure aggregate: 创建两个机组,分别为不给云主机绑定vcpu的normal机组,和给云主机绑定vcpu的performance机组。 并添加计算节点到各个机组中。---21为normal机组host,---20为performance机组。 # nova aggregate-create performance
# nova aggregate-create normal # nova aggregate-list
+----+-------------+-------------------+
| Id | Name | Availability Zone |
+----+-------------+-------------------+
| | performance | - |
| | normal | - |
+----+-------------+-------------------+ # nova aggregate-set-metadata pinned=true
# nova aggregate-set-metadata pinned=false # nova aggregate-add-host ---
Host --- has been successfully added for aggregate
+----+--------+-------------------+---------------+----------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+--------+-------------------+---------------+----------------+
| | normal | - | '10-0-192-21' | 'pinned=false' |
+----+--------+-------------------+---------------+----------------+
# nova aggregate-add-host ---
Host --- has been successfully added for aggregate
+----+-------------+-------------------+---------------+---------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+-------------+-------------------+---------------+---------------+
| | performance | - | '10-0-192-20' | 'pinned=true' |
+----+-------------+-------------------+---------------+---------------+ . Configure flavor:
Add metadata 'aggregate type: normal' to old flavor: 将已经存在的flavor的metadata的机组vcpu绑定属性设置为不绑定:
#for FLAVOR in ` nova flavor-list | cut -f -d ' ' | grep [-]* | 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-.vcpuPin
#nova flavor-create m1.small.vcpuPin ... ...
#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---20服务器上,检查虚拟机的xml配置信息是否包含vcpu绑定配置:
#nova boot --image ... Attention:
. 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节点。

最新文章

  1. [原] KVM 虚拟化原理探究(5)— 网络IO虚拟化
  2. href="javascript:xxx(this);"和onclick="javascript:xxx(this);"的区别
  3. href,src,url 整理
  4. A Regularized Competition Model for Question Diffi culty Estimation in Community Question Answering Services-20160520
  5. RDIFramework.NET ━ 9.3 用户管理 ━ Web部分
  6. 使用greenDAO生成DAO代码
  7. 【linux命令】:查看系统运行状态,命令top 【转载】
  8. iOS字体设置
  9. 【Java基础】static关键字的理解
  10. C基本语句测试
  11. How to Install Tomcat
  12. jQuery 的.data()方法
  13. php 编程效率(3)
  14. javascript获取表单的各项值
  15. DAY12、装饰器
  16. Foundry feats. MultiverseStudio
  17. JVM规范系列开篇:为什么要读JVM规范?
  18. luogu 2704 炮兵阵地 状压dp
  19. vim 撤销 回退操作
  20. Django 编写模板并渲染的示例

热门文章

  1. 【luogu P3378 堆】 模板
  2. centos修改hostname
  3. code First 四
  4. A Year in Computer Vision
  5. 使用TestFlight测试时候相关内容
  6. LeetCode11.盛最多水的容器 JavaScript
  7. 固定导航栏demo
  8. 史上最简单的SpringCloud教程 | 第五篇: 路由网关(zuul)(Finchley版本)
  9. xcode运行时候 You don’t have permission.
  10. ios appstore 上架应用被拒绝原因