 create list of servers with availability policy
        availability_servers = []
        for server in list_of_servers:
            for pg in server.placement_groups:
                if pg.policy == "availability":
                    availability_servers.append(server)
                    break

        # add servers with availability policy
        added_servers = []
        for server in availability_servers:
            scheduler_hints = {}
            for pg in server.placement_groups:
                update_scheduler_hints(scheduler_hints, added_servers, pg)
            # workround for openstack nova bug, check JIRA: YARDSTICK-200
            # for details
            if len(availability_servers) == 2:
                if not scheduler_hints["different_host"]:
                    scheduler_hints.pop("different_host", None)
                    server.add_to_template(template,
                                           self.networks,
                                           scheduler_hints)
                else:
                    scheduler_hints["different_host"] = \
                        scheduler_hints["different_host"][0]
                    server.add_to_template(template,
                                           self.networks,
                                           scheduler_hints)
            else:
                server.add_to_template(template,
                                       self.networks,
                                       scheduler_hints)
            added_servers.append(server.stack_name)

        # create list of servers with affinity policy
        affinity_servers = []
        for server in list_of_servers:
            for pg in server.placement_groups:
                if pg.policy == "affinity":
                    affinity_servers.append(server)
                    break

        # add servers with affinity policy
        for server in affinity_servers:
            if server.stack_name in added_servers:
                continue
            scheduler_hints = {}
            for pg in server.placement_groups:
                update_scheduler_hints(scheduler_hints, added_servers, pg)
            server.add_to_template(template, self.networks, scheduler_hints)
            added_servers.append(server.stack_name)

        # add server group
        for sg in self.server_groups:
            template.add_server_group(sg.name, sg.policy)

        # add remaining servers with no placement group configured
        for server in list_of_servers:
            # TODO placement_group and server_group should combine
            if not server.placement_groups:
                scheduler_hints = {}
                # affinity/anti-aff server group
                sg = server.server_group
                if sg:
                    scheduler_hints["group"] = {'get_resource': sg.name}
                server.add_to_template(template,
                                       self.networks, scheduler_hints)

    def deploy(self):
        """deploys template into a stack using cloud"""
        print("Deploying context '%s'" % self.name)

        heat_template = HeatTemplate(self.name, self.template_file,
                                     self.heat_parameters)

        if self.template_file is None:
            self._add_resources_to_template(heat_template)

        try:
            self.stack = heat_template.create()
        except KeyboardInterrupt:
            sys.exit("\nStack create interrupted")
        except RuntimeError as err:
            sys.exit("error: failed to deploy stack: '%s'" % err.args)
        except Exception as err:
            sys.exit("error: failed to deploy stack: '%s'" % err)

        # copy some vital stack output into server objects
        for server in self.servers:
            if server.ports:
                # TODO(hafe) can only handle one internal network for now
                port = next(iter(server.ports.values()))
                server.private_ip = self.stack.outputs[port["stack_name"]]

            if server.floating_ip:
                server.public_ip = \
                    self.stack.outputs[server.floating_ip["stack_name"]]

        print("Context '%s' deployed" % self.name)

    def undeploy(self):
        """undeploys stack from cloud"""
        if self.stack:
            print("Undeploying context '%s'" % self.name)
            self.stack.delete()
            self.stack = None
            print("Context '%s' undeployed" % self.name)

        if os.path.exists(self.key_filename):
            try:
                os.remove(self.key_filename)
                os.remove(self.key_filename + ".pub")
            except OSError:
                LOG.exception("Key filename %s", self.key_filename)

        super(HeatContext, self).undeploy()

    def _get_server(self, attr_name):
        """lookup server info by name from context
        attr_name: either a name for a server created by yardstick or a dict
        with attribute name mapping when using external heat templates
        """
        key_filename = pkg_resources.resource_filename(
            'yardstick.resources',
            'files/yardstick_key-' + get_short_key_uuid(self.key_uuid))

        if isinstance(attr_name, collections.Mapping):
            cname = attr_name["name"].split(".")[1]
            if cname!= self.name:
                return None

            public_ip = None
            private_ip = None
            if "public_ip_attr" in attr_name:
                public_ip = self.stack.outputs[attr_name["public_ip_attr"]]
            if "private_ip_attr" in attr_name:
                private_ip = self.stack.outputs[
                    attr_name["private_ip_attr"]]

            # Create a dummy server instance for holding the *_ip attributes
            server = Server(attr_name["name"].split(".")[0], self, {})
            server.public_ip = public_ip
            server.private_ip = private_ip
        else:
            if attr_name not in self._server_map:
                return None
            server = self._server_map[attr_name]

        if server is None:
            return None

        result = {
            "user": server.context.user,
            "key_filename": key_filename,
            "private_ip": server.private_ip
        }
        # Target server may only have private_ip
        if server.public_ip:
            result["ip"] = server.public_ip

        return result
This session is a PhocusWright-style discussion among investors with a track record in the vacation rentals space on major trends, associated threats, and opportunities for VR managers. Hear these investors discuss topics like: how to map the industry, the winners and losers of consolidation, the fads versus the game-changers of technology, how to find investors for your business, and much more.
DHS First X1 Cricket Success!
Our First X1 Cricket team had another great win on the weekend.
On Wednesday 3rd March, Session 2 for the Kapa Haka group consisted of Waiata and games - Poi raku.
Below are the results of the 2021 Swimming Sports held on Friday 12th February.“I guess…you know a point guard is pretty important, so I like Andrew, Andrew Harrison,” Randle said.
Tyus Jones played three games with back spasms and was forced to sit out a fourth as his high school team, Apple Valley of Minnesota, rallied for a 73-64 victory on Wednesday.
"I don't know when he will be back," Apple Valley coach Zach Goring said. "I'm not going to bring him back now until he's 100 percent healthy."
Jones, the nation's top-ranked recruit in the class of 2014, hasn't practiced since Dec. 11.
Despite his back issues, Jones averaged 29.7 points in Apple Valley's first three games.
Andrew Wiggins scored 32 points, grabbed 10 rebounds and quieted a somewhat hostile crowd in Huntington Prep’s 61-54 win over Walnut Hills on Friday.
Amid taunts of “overrated” and “U-S-A” from the opposing student section, the Canadian scored nine points to ignite a 14-3 run to close the first half.
Wiggins was the only double-figure scorer for Huntington, which improved to 11-0 on the season.
Jabari Parker scored just five points and was called for five traveling violations in Simeon Academy’s 67-57 loss to DeSoto on Thursday night.
"We've got a long ways to go," Parker said. "I just came off an injury, and it's going to be a long time. Phys