Create the node.

        This method should only be called by the BaremetalFactory.

def deploy(self, image_name, ip, flavor='m1.small'):
        """Create the node.

        This method should only be called by the BaremetalFactory.
        """
        body_value = {
            "port": {
                "admin_state_up": True,
                "name": self.name + '_provision',
                "network_id": os_utils.get_network_id(self.nova_api, 'provision_bob'),
                'fixed_ips': [{'ip_address': ip}]}}
        response = self.neutron.create_port(body=body_value)
        self._provision_port_id = response['port']['id']
        self.mac = response['port']['mac_address']

        image_id_to_boot_from = os_utils.get_image_id(self.nova_api, image_name)
        flavor_id = os_utils.get_flavor_id(self.nova_api, flavor)
        # TODO(Gonéri): We don't need keypair for the BM nodes
        keypair_id = os_utils.get_keypair_id(self.nova_api, self._keypair)
        # Ensure with get DHCP lease on the provision network first
        nics = [{'port-id': self._provision_port_id}]

        self._os_instance = os_provisioner.build_openstack_instance(
            self.nova_api,
            self.name,
            image_id_to_boot_from,
            flavor_id,
            keypair_id,
            nics)

        if not self._os_instance:
            LOG.error("deployment has failed")
            raise Exception()

        os_provisioner.add_provision_security_group(self.nova_api)
        os_utils.add_security_groups(self._os_instance, ['provision'])
        os_utils.add_security_groups(self._os_instance, self._security_groups)
        LOG.info("add security groups '%s'" % self._security_groups)
        LOG.info("instance '%s' ready to use" % self.name)

        # the instance should be off for Ironic
        self._os_instance.stop()