OpenStack配置虚拟机vcpu绑定步骤 转至元数据结尾
2024-10-02 05:28:23
. 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节点。
最新文章
- [原] KVM 虚拟化原理探究(5)— 网络IO虚拟化
- href=";javascript:xxx(this);";和onclick=";javascript:xxx(this);";的区别
- href,src,url 整理
- A Regularized Competition Model for Question Diffi culty Estimation in Community Question Answering Services-20160520
- RDIFramework.NET ━ 9.3 用户管理 ━ Web部分
- 使用greenDAO生成DAO代码
- 【linux命令】:查看系统运行状态,命令top 【转载】
- iOS字体设置
- 【Java基础】static关键字的理解
- C基本语句测试
- How to Install Tomcat
- jQuery 的.data()方法
- php 编程效率(3)
- javascript获取表单的各项值
- DAY12、装饰器
- Foundry feats. MultiverseStudio
- JVM规范系列开篇:为什么要读JVM规范?
- luogu 2704 炮兵阵地 状压dp
- vim 撤销 回退操作
- Django 编写模板并渲染的示例