@@ -982,7 +982,7 @@ public void allocate(VirtualMachineProfile<? extends VMInstanceVO> vm, List<Pair
982982 nics .add (vo );
983983
984984 NetworkOffering no = _configMgr .getNetworkOffering (config .getNetworkOfferingId ());
985- Integer networkRate = _configMgr .getNetworkRate (no .getId ());
985+ Integer networkRate = _configMgr .getNetworkRate (no .getId (), vm . getType () );
986986 vm .addNic (new NicProfile (vo , network .first (), vo .getBroadcastUri (), vo .getIsolationUri (), networkRate ));
987987 }
988988
@@ -1075,7 +1075,7 @@ protected NicTO toNicTO(NicVO nic, NicProfile profile, NetworkVO config) {
10751075 to .setDns2 (profile .getDns2 ());
10761076 }
10771077
1078- Integer networkRate = _configMgr .getNetworkRate (config .getNetworkOfferingId ());
1078+ Integer networkRate = _configMgr .getNetworkRate (config .getNetworkOfferingId (), null );
10791079 to .setNetworkRateMbps (networkRate );
10801080
10811081 return to ;
@@ -1196,7 +1196,7 @@ public int compare(NicVO nic1, NicVO nic2){
11961196 NetworkGuru guru = implemented .first ();
11971197 NetworkVO network = implemented .second ();
11981198 NetworkOffering no = _configMgr .getNetworkOffering (network .getNetworkOfferingId ());
1199- Integer networkRate = _configMgr .getNetworkRate (no .getId ());
1199+ Integer networkRate = _configMgr .getNetworkRate (no .getId (), vmProfile . getType () );
12001200 NicProfile profile = null ;
12011201 if (nic .getReservationStrategy () == Nic .ReservationStrategy .Start ) {
12021202 nic .setState (Nic .State .Reserving );
@@ -1246,7 +1246,7 @@ public <T extends VMInstanceVO> void prepareNicForMigration(VirtualMachineProfil
12461246 for (NicVO nic : nics ) {
12471247 NetworkVO network = _networksDao .findById (nic .getNetworkId ());
12481248 NetworkOffering no = _configMgr .getNetworkOffering (network .getNetworkOfferingId ());
1249- Integer networkRate = _configMgr .getNetworkRate (no .getId ());
1249+ Integer networkRate = _configMgr .getNetworkRate (no .getId (), vm . getType () );
12501250
12511251 NetworkGuru guru = _networkGurus .get (network .getGuruName ());
12521252 NicProfile profile = new NicProfile (nic , network , nic .getBroadcastUri (), nic .getIsolationUri (), networkRate );
@@ -1303,7 +1303,7 @@ public List<NicProfile> getNicProfiles(VirtualMachine vm) {
13031303 for (Nic nic : nics ) {
13041304 NetworkVO network = _networksDao .findById (nic .getNetworkId ());
13051305 NetworkOffering no = _configMgr .getNetworkOffering (network .getNetworkOfferingId ());
1306- Integer networkRate = _configMgr .getNetworkRate (no .getId ());
1306+ Integer networkRate = _configMgr .getNetworkRate (no .getId (), vm . getType () );
13071307
13081308 NetworkGuru guru = _networkGurus .get (network .getGuruName ());
13091309 NicProfile profile = new NicProfile (nic , network , nic .getBroadcastUri (), nic .getIsolationUri (), networkRate );
0 commit comments