Hi Mikolaj, thanks for reporting that. I think the best approach would be to make jclouds aware of the obsolete machineTypes by considering the deprecated field in the MachineType domain object, so (b) if I get you right.
I've already a patch that deals with it that I can submit asap. Best, Andrea On Fri, Apr 25, 2014 at 1:26 PM, Mikołaj Zalewski <[email protected]> wrote: > Hi, > When working with jclouds I've stumbled on a problem during GCE VM > creation. If I specify machine hardware by constraints, the framework can > find an obsolete hardware profile and the creation will fail (an obsolete > hardware profile in GCE means that one can't create new instance of this > platform, but there may still be instances running). I've opened JIRA > 550<https://issues.apache.org/jira/browse/JCLOUDS-550>for it. What's > the recommended way to fix this? I can think of three ways: > (a) don't advertise obsolete (and deleted) machine types in > computeService.listHardwareProfiles() > at all. > (b) add the notion of an obsolete (as well as deleted and deprecated?) > profile to the base Hardware object and use it in TemplateBuilderImpl to > filter out these profiles. > (c) try to use some subclassing/injections for the TemplateBuilder to > work differently for GCE than for others and to know about the hardware > states. > I personally don't like (c) while as for (a) and (b) I don't have the > experience about possible side-effects to choose one. What's you advise > which solution is the best? > > Mikołaj Zalewski > > PS: choosing one of the hardware profiles from > computeService.listHardwareProfiles() > and passing it to TemplateBuilder.fromHardware() doesn't necessarily lead > to this profile being chosen, as only some fields from the parameter are > used as constraints and the id is not one of them. Is this a bug or a > feature?
