I don't really see why you need instance type passed in, you can calculate the number of vcps that are being requested for each instance as "req_cores/instances" can't you ?
Ignore my earlier suggestion about calling Quote.reserve multiple times - doing the headroom calculation inside reserve would avoid that.
I don't really see why you need instance type passed in, you can calculate the number of vcps that are being requested for each instance as "req_cores/ instances" can't you ?
Ignore my earlier suggestion about calling Quote.reserve multiple times - doing the headroom calculation inside reserve would avoid that.