# Compute node (HCI) Replacement Guide

> Goto `Admin > Compute > All Hypervisors` and click `Compute host` tab. Look for the hostname you wish to remove and click on button `DISABLE SERVICE`

## Remove Compute node from cluster {#remove-compute-node-from-cluster}

### Stop the compute host {#stop-the-compute-host}

Goto `Admin > Compute > All Hypervisors` and click `Compute host` tab. Look for the hostname you wish to remove and click on button `DISABLE SERVICE`

![/assets/maintenances/01-disable.png](/assets/maintenances/01-disable.png)

### Disable service {#disable-service}

Leave a reason and click `DISABLE SERVICE`
![/assets/maintenances/02-disable.png](/assets/maintenances/02-disable.png)

### Service Disabled {#service-disabled}

Make sure the service is disabled
![/assets/maintenances/03-disable.png](/assets/maintenances/03-disable.png)

### Migrate Instances from disabled host {#migrate-instances-from-disabled-host}

Goto `Admin > Compute > Instances`, look for the instances which is hosted on `DISABLED Host` and start the `LIVE MIGRATE INSTANCE` from the action menu

![/assets/maintenances/04-live-migrate.png](/assets/maintenances/04-live-migrate.png)

### Allocate the instance to new host {#allocate-the-instance-to-new-host}

You can choose a preferred host to migrate or Automatically and `SUBMIT`
![/assets/maintenances/05-live-migrate.png](/assets/maintenances/05-live-migrate.png)

![/assets/maintenances/06-live-migrate.png](/assets/maintenances/06-live-migrate.png)

### All instances has been migrated {#all-instances-has-been-migrated}

Repeat the steps and migrate the rest of the Instances

![/assets/maintenances/07-live-migrate.png](/assets/maintenances/07-live-migrate.png)

### Connect to control node {#connect-to-control-node}

```bash
    $ ssh admin@192.168.1.x
    Warning: Permanently added '192.168.1.x' (ECDSA) to the list of known hosts.
    Password:
```

### Remove the compute node {#remove-the-compute-node}

```bash
    cc1> cluster
    cc1:cluster> remove_node
    1: compute01
    2: cc3
    3: compute02
    4: cc1
    5: cc2
    Enter index: 3
    this command is only applicable for compute or storage nodes
    make sure its running instances have been properly terminated or migrated
    shutdown the target host before proceeding
    Enter 'YES' to confirm: YES
```

### Results {#results}

Goto `Admin > Compute > All Hypervisors` and click `Compute host` tab. Host `compute02` has been removed from the Cluster

![/assets/maintenances/08-live-migrate.png](/assets/maintenances/08-live-migrate.png)

### Backup Compute02 policies {#backup-compute02-policies}

From your local pc terminal

```bash
    $ scp -r root@Compute02_<your-cluster-vip>:/etc/policies Downloads/compute02_policy
```

### Shutdown the compute02 {#shutdown-the-compute02}

## Adding Compute Host {#adding-compute-host}

Prepare a new node with CubeCOS installed

### Configuration {#configuration}

Reconfigure a new compute02 node by following any options of the list below:

- [Compute node installation](../../configuration/node_roles/compute_hci)
- Swift Deploy with existing policy (recommended)

### Connect to controller {#connect-to-controller}

```bash
    $ ssh admin@192.168.1.x
    Warning: Permanently added '192.168.1.x' (ECDSA) to the list of known hosts.
    Password:
```

### Check & Repair services {#check--repair-services}

```bash
Welcome to the Cube Appliance
Enter "help" for a list of available commands
cc1> cluster
cc1:cluster> check
          Service  Status  Report
      ClusterLink      ok  [ link(v) clock(v) dns(v) ]
       ClusterSys      ok  [ bootstrap(v) license(v) ]
  ClusterSettings      ok  [ etcd(v) ]
        HaCluster      ok  [ hacluster(v) ]
         MsgQueue      ok  [ rabbitmq(v) ]
           IaasDb      ok  [ mysql(v) ]
        VirtualIp      ok  [ vip(v) haproxy_ha(v) ]
          Storage      ok  [ ceph(v) ceph_mon(v) ceph_mgr(v) ceph_mds(v) ceph_osd(v) ceph_rgw(v) rbd_target(v) ]
       ApiService      ok  [ haproxy(v) httpd(v) lmi(v) memcache(v) ]
     SingleSignOn      ok  [ keycloak(v) ]
          Compute      ok  [ nova(v) ]
        Baremetal      ok  [ ironic(v) ]
          Network      ok  [ neutron(v) ]
            Image      ok  [ glance(v) ]
        BlockStor      ok  [ cinder(v) ]
         FileStor      ok  [ manila(v) ]
       ObjectStor      ok  [ swift(v) ]
    Orchestration      ok  [ heat(v) ]
            LBaaS      ok  [ octavia(v) ]
           DNSaaS      ok  [ designate(v) ]
           K8SaaS      ok  [ k3s(v) rancher(v) ]
       InstanceHa      ok  [ masakari(v) ]
 DisasterRecovery      ok  [ freezer(v) ]
    BusinessLogic      ok  [ mistral(v) murano(v) cloudkitty(v) senlin(v) watcher(v) ]
       ApiManager      ok  [ tyk(v) redis(v) mongodb(v) ]
         DataPipe      ok  [ zookeeper(v) kafka(v) ]
          Metrics      ok  [ monasca(v) telegraf(v) grafana(v) ]
     LogAnalytics      ok  [ filebeat(v) auditbeat(v) logstash(v) es(v) kibana(v) ]
    Notifications      ok  [ influxdb(v) kapacitor(v) ]
cc1:cluster>
```

### Results {#results-1}

Goto `Admin > Compute > All Hypervisors` and click `Compute host` tab. Host `compute02` has been added back to the Cluster

![/assets/maintenances/09-hypervisors.png](/assets/maintenances/09-hypervisors.png)
