def register_host(self, bm_instance):
        """Register an existing nova VM.

        A new interface will be attached to the BMC host with a new IP. An openstackbmc
        service will be binded to this IP.

        Once the VM has been registered, it is possible to use IPMI on this IP
        to start or stop the virtual machine.
        """
        bmc_ip = '10.130.%d.100' % (self._bmc_range_start + self._nic_cpt)
        bmc_net = '10.130.%d.0' % (self._bmc_range_start + self._nic_cpt)
        bmc_gw = '10.130.%d.1' % (self._bmc_range_start + self._nic_cpt)
        device = 'eth%d' % (2 + self._nic_cpt)
        body_create_subnet = {
            'subnets': [{
                'name': 'bmc_' + device,
                'cidr': bmc_net + '/24',
                'ip_version': 4,
                'network_id': self._bmc_net['id']}]}
        subnet_id = self.neutron.create_subnet(body=body_create_subnet)['subnets'][0]['id']
        self.attach_subnet_to_router(subnet_id)
        self.os_instance.interface_attach(None, self._bmc_net['id'], bmc_ip)
        content = """
DEVICE="{device}"
BOOTPROTO=static
IPADDR={bmc_ip}
NETMASK=255.255.255.0
ONBOOT=yes
"""
        self.create_file(
            '/etc/sysconfig/network-scripts/ifcfg-%s' % device,
            content=content.format(device=device, bmc_ip=bmc_ip, bmc_gw=bmc_gw))

        content = """
192.0.2.0/24 via {bmc_gw}
"""
        self.create_file(
            '/etc/sysconfig/network-scripts/route-%s' % device,
            content=content.format(bmc_gw=bmc_gw))
        self.run('ifup %s' % device)

        # Ensure the outgoing traffic go through the correct NIC to avoid spoofing
        # protection
        # TODO(Gonéri): This should be persistant.
        self.run('ip rule add from %s table %d' % (bmc_ip, self._nic_cpt + 2))
        self.run('ip route add default via %s dev %s table %d' % (bmc_gw, device, self._nic_cpt + 2))

        content = """
[Unit]
Description=openstack-bmc {bm_instance} Service
[Service]
ExecStart=/usr/local/bin/openstackbmc  --os-user {os_username} --os-password {os_password} --os-project-id {os_project_id} --os-auth-url {os_auth_url} --instance {bm_instance} --address {bmc_ip}
User=root
StandardOutput=kmsg+console
StandardError=inherit
Restart=always
[Install]
WantedBy=multi-user.target
"""
        unit = 'openstack-bmc-%d.service' % self._nic_cpt
        self.create_file(
            '/usr/lib/systemd/system/%s' % unit,
            content.format(
                os_username=self.os_username,
                os_password=protect_password(self.os_password),
                os_project_id=self.os_project_id,
                os_auth_url=self.os_auth_url,
                bm_instance=bm_instance,
                bmc_ip=bmc_ip))
        self.run('systemctl enable %s' % unit)
        self.run('systemctl start %s' % unit)
        self._nic_cpt += 1

        return bmc_ip
Register an existing nova VM.

        A new interface will be attached to the BMC host with a new IP. An openstackbmc
        service will be binded to this IP.

        Once the VM has been registered, it is possible to use IPMI on this IP
        to start or stop the virtual machine.