set the cpu weight based on cpu * cores

This commit is contained in:
Edison Su 2011-12-15 15:08:14 -08:00
parent 9312823c97
commit a4d1ce3f87
3 changed files with 5 additions and 1 deletions

View File

@ -120,6 +120,9 @@ public class KVMGuestOsMapper {
s_mapper.put("Windows 95", "Windows 95");
s_mapper.put("Windows NT 4", "Windows NT");
s_mapper.put("Windows 3.1", "Windows 3.1");
s_mapper.put("Windows PV", "Other PV");
s_mapper.put("Other PV (32-bit)", "Other PV");
s_mapper.put("Other PV (64-bit)", "Other PV");
}
public static String getGuestOsName(String guestOsName) {

View File

@ -2287,7 +2287,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
s_logger.debug("starting " + vmName + ": " + vm.toString());
startDomain(conn, vmName, vm.toString());
Script.runSimpleBashScript("virsh schedinfo " + vmName + " --set cpu_shares=" + vmSpec.getCpus() * vmSpec.getSpeed());
NicTO[] nics = vmSpec.getNics();
for (NicTO nic : nics) {

View File

@ -171,6 +171,7 @@ INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (139, 7, '
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (140, 7, 'Other PV (64-bit)');
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (141, 9, 'Sun Solaris 11 (64-bit)');
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (142, 9, 'Sun Solaris 11 (32-bit)');
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (143, 6, 'Windows PV');
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (200, 1, 'Other CentOS (32-bit)');
INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (201, 1, 'Other CentOS (64-bit)');