You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by WXR <14...@qq.com> on 2013/07/10 15:22:40 UTC

Some allocation algorithm questions about instance and volume

1.Can cloudstack allocate vm instances averagely between host nodes?

The default value of vm.allocation.algorithm is "random".
If there is just one host node in a cluster(we call it A) and I create 20 instances,all of them will be allocated on host A.Now I add another host B,and create 30 instance again,what will happen?
I think the number of instances on A is 35,on B is 15,according to probability theory.But I hope the result is 25 on A,25 on B,but I don't know how to configure cloudstack to achieve it.

--------

2.The similar question about volume allocating.

If I have two empty primary storage pools in a cluster,the volumes of vms will be allocated randomly on both of them.
But If I have a primary storage with 20 volumes and an empty primary storage,how can I let new volumes allocated 
averagely on them?

--------

3.How to set a standby host in a cluster?
There is there host nodes A,B,C ,vm instances are allocated randomly on them.
Now I want to add a standby host node D into the cluster.
If there are enough compute resources on A,B,C ,no new instance will be allocated on D.
But if A breaks down and there are not enough resources on B,C , many of the vms on A will be migrated to D.
Is it possible to set a standby host like this?

RE: Some allocation algorithm questions about instance and volume

Posted by Prachi Damle <Pr...@citrix.com>.
Hi,

I have added some comments inline. 

Thanks,
Prachi

-----Original Message-----
From: WXR [mailto:1485739420@qq.com] 
Sent: Wednesday, July 10, 2013 6:23 AM
To: users
Subject: Some allocation algorithm questions about instance and volume

1.Can cloudstack allocate vm instances averagely between host nodes?

The default value of vm.allocation.algorithm is "random".
If there is just one host node in a cluster(we call it A) and I create 20 instances,all of them will be allocated on host A.Now I add another host B,and create 30 instance again,what will happen?
I think the number of instances on A is 35,on B is 15,according to probability theory.But I hope the result is 25 on A,25 on B,but I don't know how to configure cloudstack to achieve it.

[Prachi] Currently there is no implementation to balance the instances across available hosts. 
If you are using single cloudstack account to create the instances, setting vm.allocation.algorithm to 'userdispersing' can help you achieve the balance. 
'userdispersing' will always choose a host with less number of instances of the two hosts.

--------

2.The similar question about volume allocating.

If I have two empty primary storage pools in a cluster,the volumes of vms will be allocated randomly on both of them.
But If I have a primary storage with 20 volumes and an empty primary storage,how can I let new volumes allocated averagely on them?

[Prachi] Same as above. No implementation for balancing. But  'userdispersing' can help.
--------

3.How to set a standby host in a cluster?
There is there host nodes A,B,C ,vm instances are allocated randomly on them.
Now I want to add a standby host node D into the cluster.
If there are enough compute resources on A,B,C ,no new instance will be allocated on D.
But if A breaks down and there are not enough resources on B,C , many of the vms on A will be migrated to D.
Is it possible to set a standby host like this?

[Prachi] You can achieve this by setting the global config variable 'ha.tag' to some value and adding a hosttag with same value for the host D.
This will ensure that host D is used only for HA purposes.