cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daan Hoogland <daan.hoogl...@gmail.com>
Subject Re: bug? capacity not updated when adding memory to hypervisor
Date Wed, 25 Sep 2013 20:50:08 GMT
That would not seem in place in one of these blocks altogether, would it?


On Wed, Sep 25, 2013 at 10:45 PM, Darren Shepherd <
darren.s.shepherd@gmail.com> wrote:

> The main bug being the lack of
> memCap.setTotalCapacity(host.getTotalMemory());
>
> Darren
>
> On Wed, Sep 25, 2013 at 1:13 PM, Daan Hoogland <daan.hoogland@gmail.com>
> wrote:
> > I agree Darren,
> >
> > if (cpuCap.getUsedCapacity() == usedCpu &&
> > cpuCap.getReservedCapacity() == reservedCpu) {
> > } else {
> >    if (cpuCap.getReservedCapacity() != reservedCpu) {
> >                 cpuCap.setReservedCapacity(reservedCpu);
> >    }
> >    if (cpuCap.getUsedCapacity() != usedCpu) {
> >                 cpuCap.setUsedCapacity(usedCpu);
> >             }
> > }
> >
> > makes more sense. (same for mem)
> >
> >
> > On Wed, Sep 25, 2013 at 9:59 PM, Darren Shepherd <
> > darren.s.shepherd@gmail.com> wrote:
> >
> >> I added more memory to a hypervisor, and the host tables was updated
> >> properly, but the op_host_capacity is not updated.  I tracked down the
> >> code to CapacityManagerImpl.updateCapacityForHost.  The below logic
> >> seems completely wrong.  Unless I'm reading it wrong, it seems like it
> >> will only update EITHER used or reserved (not both) and never update
> >> total.  I removed log statements to make it more readable.
> >>
> >> if (cpuCap.getUsedCapacity() == usedCpu &&
> >> cpuCap.getReservedCapacity() == reservedCpu) {
> >>             } else if (cpuCap.getReservedCapacity() != reservedCpu) {
> >>                 cpuCap.setReservedCapacity(reservedCpu);
> >>             } else if (cpuCap.getUsedCapacity() != usedCpu) {
> >>                 cpuCap.setUsedCapacity(usedCpu);
> >>             }
> >>
> >>             if (memCap.getUsedCapacity() == usedMemory &&
> >> memCap.getReservedCapacity() == reservedMemory) {
> >>             } else if (memCap.getReservedCapacity() != reservedMemory) {
> >>                 memCap.setReservedCapacity(reservedMemory);
> >>             } else if (memCap.getUsedCapacity() != usedMemory) {
> >>                 memCap.setUsedCapacity(usedMemory);
> >>             }
> >>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message