cloudstack修改超分比
修改cpu超分比
1、查询
cmk list clusters filter=name,id,cpuovercommitratio keyword=pod01-SC
+--------------------+--------------------------------------+--------------+
| CPUOVERCOMMITRATIO | ID | NAME |
+--------------------+--------------------------------------+--------------+
| 3.0 | 4e9bc92e-bacf-472c-b057-6aa648d903a4 | pod01-SC-C01 |
| 3.0 | e17b57cb-3bd1-4a91-b184-d63030027fbb | pod01-SC-C02 |
| 3.0 | 8b0475a0-369b-4dac-bdc7-0cbf3e97a06f | pod01-SC-C03 |
| 3.0 | d0e5a899-f48a-435c-85e0-9c76a6ca99c8 | pod01-SC-C04 |
| 3.0 | 667760e3-ec3a-4b54-b303-2343dadfc722 | pod01-SC-C05 |
略。。。
2、修改cs
cmk update configuration name=cpu.overprovisioning.factor value=3.0 clusterid=72274a2b-cb18-475e-8bd4-b4b579f6ef68
3、修改数据库
update user_vm_details set value='3.0' where vm_id in (select id from vm_instance where host_id in (select id from host where removed is null and cluster_id in (select id from cluster where name in ("C-t1-Pod1-02","C-t1-Pod1-03","C-t1-Pod1-04","C-t1-Pod1-05","C-t1-Pod1-06","C-t1-Pod1-07")))) and name='cpuOvercommitRatio';
检查
select value from user_vm_details where vm_id in (select id from vm_instance where host_id in (select id from host where removed is null and cluster_id in (select id from cluster where name in ("C-t1-Pod1-02","C-t1-Pod1-03","C-t1-Pod1-04","C-t1-Pod1-05","C-t1-Pod1-06","C-t1-Pod1-07")))) and name='cpuOvercommitRatio';
修改主存储超分比
场景1、如果所有主存储的超分都是一样:
UPDATE `configuration` set value = '$' where name = ' storage.overprovisioning.factor';
场景2、如果各个主存储的超分比不一样:
1)从页面或者DB里面得到主存储ID
2))插入storage_pool_details表记录:INSERT INTO `storage_pool_details` (pool_id,name,value,display) value ($pool_id, 'storage.overprovisioning.factor', '$value', 1);
场景2为例
insert into storage_pool_detail(pool_id,name,value,display) value(186,'storage.overprovisioning.factor',2,1);
insert into storage_pool_details(pool_id,name,value,display) value(186,'storage.overprovisioning.factor',2,1);
insert into storage_pool_details(pool_id,name,value,display) value(187,'storage.overprovisioning.factor',2,1);
insert into storage_pool_details(pool_id,name,value,display) value(188,'storage.overprovisioning.factor',2,1);
修改cpu\memory 85% disablethreshold
for i in $(cat c_id.txt); do cmk update configuration clusterid=$i name=cluster.memory.allocated.capacity.disablethreshold value=0.95; done
检查
for i in $(cat c_id.txt); do cmk list configurations name=cluster.memory.allocated.capacity.disablethreshold clusterid=$i; done

浙公网安备 33010602011771号