-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 03/26/2015 06:12 PM, bob wrote: > Hello, I am using a PHP API to cloudstack 4.4.2 - When I make the > call to deployVirtualMachine and attempt to pass the parm > details[0].networkrate = 1 it does not rate limit the network to > 1MB. What am I doing wrong? > Can you check the XML definition of the guest on the hypervisor? $ virsh dumpxml i-VM-XXXX In the network section you should see a network throttle setting. If not, it might be that your Qemu or libvirt is to old. I'm not sure what versions you need. > It is using the default value from Global Settings: > vm.network.throttling.rate and ignores my VM compute service > offering rate. How do I force it to use the rate defined by my api > call to deployVirtualMachine? > > Here is my PHP code: //... $displayVM = "true"; // an optional > field, whether to the display the vm to the end user or not. > $hypervisor = "KVM"; //the hypervisor on which to deploy the > virtual machine > > $vars = array( // Required by API call: 'serviceofferingid' => > CUSTOM_COMPUTE_OFFERING, 'templateid'=>$templateId, > 'zoneid'=>ZONE_ID, // Optional but useful: > 'details[0].networkrate'=>1, // Network Throttling of 1MB/s not > working here... // 'networkrate'=>1, > 'account'=>$account, 'displayname'=>$displayName, > 'displayvm'=>$displayVM, 'domainid'=>$domainid, //ROOT_DOMAIN_ID, > 'hypervisor'=>$hypervisor, 'name'=>$name, > 'networkids'=>NETWORK_ID, ); // > https://github.com/jasonhancock/cloudstack-api-extension //... > $deploy = $cloudstack->deployVirtualMachine($vars); // does curl > request... > > Note: It will create the VM and runs fine with no errors > generated... However, when I download a 10 MB test file it will get > 10MB/s download, and does not limit it to 1MB/s. Also, when I use > the cloudstack interface to look at the Instance Details, I do not > see any rate limit set. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVFG93AAoJEAGbWC3bPspCc5UP/2/JDa7PHsDoaoOCYQlOPYaT tlJBpRviHkWl/IB5Dup86nDF6GjNYrwbRA0+YKn2E8UwgJ+lAz13Vkqg3eCLH3OK Na++WFMNePlR/MOYKRic0XuW+8YflKwKfxTs2OU96y5t3DqBuZzVpBKEKvxprTqv 5uhJZLnyoA1AZotg+oMAgD07SBtnFEIqlIxiP/K7UROPMnE0D8pUOVD4Z2Tdrh5p Rc7yNHU9XbLJjxuf1fpZkTmA6Htt+Qb4r3K4aOztmt6n7I1ov91HQSUQaYH3jQnJ t06apLb8Ip4w85HpfqupfVQAVF26swawi7ghuJ/BVvG+/EaY4nyyhoUPoM6Q42fW YusLbfCWaOM8yB0Hr0TjGBPAXzuIKcI1j4KxX13WONBMTNqn34TYanxXDD2UhYZE 6W8sfB3+cF0N4HF1EBTKDAYRcVolqZWILuvYIx1VmFEuJfSljg+X47ULI/keiuWX vcdagoS2eJCsVreym5S6lbd3jFjJibpcu+MUsT0Rb9M8hvdZ3b/x3+mHaXaAhErQ 4xOoZhbD+rbeBfD+WP6HOJRLvGsdPfSMJXxxdWz+xgIn4Odbc/eoV/zuVPGuHBSE e5JqqLuXRzQPmktrP0uxMPgyqUH/hjyW+6g4F5A3/siixjziI2NfvfEzJ1qGDtFw d3H56NFlcAPmD5/+Ldew =ii1N -----END PGP SIGNATURE-----