# How-to-change-the-vertica-server-instance-type_686065564
To change the instance type, we need to create another subcluster with the new instance type, change the new subcluster as primary and remove the old subcluster.

### Before the change window

#### Contact MFI-ProductSecOps@opentext.com to disable scp

#### Add another subscluter

![](attachments/686065564/686065556.png)

#### tag the instances like below, change the parameters accordingly

```
profile='609729173090_Fed_Account_ESM_SaaS_OPS'
name='SMA-Worker'
role='sma'
accountno='609729173090'
uppername='us24-prod-vertica-node-linux'
resource='i-0cc3ffd574d36c2b0'
owner='i-0e722ecadc153ef16'
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=Stack,Value=production
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=name,Value=$name
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=owner,Value=smaxaasops@microfocus.com
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=environment,Value=production
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=role,Value=$role
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=acc-no,Value=$accountno
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=bu,Value=itom
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=product,Value=esm
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=type,Value=trade
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=app-id,Value=SMAX
aws ec2 create-tags --profile $profile --resources $resource  --tags Key=cust-name,Value=multi-tenant
aws ec2 create-tags --profile $profile --resources $resource  --tags 'Key="data label",Value=pii'
aws ec2 create-tags --profile $profile --resources $resource  --tags 'Key="Name"',Value=$uppername
aws ec2 create-tags --profile $profile --resources $resource  --tags 'Key="Owner"',Value=$owner

do the same for all the worker nodes
```

![](attachments/686065564/686065557.png)

### During the change window

#### change the new subcluster to primary cluster:

```
https://www.vertica.com/docs/9.3.x/HTML/Content/Authoring/Eon/Subclusters/AlteringSubclusters.htm

In vertica SQL command line like vsql:

 SELECT DISTINCT subcluster_name, is_primary from subclusters;
 SELECT PROMOTE_SUBCLUSTER_TO_PRIMARY('subcluster_a');

add the new instances to the NLB

-- set subcluster_a as default cluster:
ALTER SUBCLUSTER subcluster_a SET DEFAULT;

Remove the old instances from the NLB
```

![](attachments/686065564/686065558.png)

```
-- demote the old subcluster
SELECT DEMOTE_SUBCLUSTER_TO_SECONDARY('default_subcluster');

-- remove the old subcluster
```

![](attachments/686065564/686065559.png)

![](attachments/686065564/686065560.png)

#### scale down new cluster from 4 to 3

![](attachments/686065564/686065561.png)

```
Remove the old instance from the NLB
```

## Attachments:

[image2024-3-20\_17-31-3.png](attachments/686065564/686065556.png) (image/png)  
[image2024-3-20\_17-31-43.png](attachments/686065564/686065557.png) (image/png)  
[image2024-3-20\_17-33-2.png](attachments/686065564/686065558.png) (image/png)  
[image2024-3-20\_17-33-16.png](attachments/686065564/686065559.png) (image/png)  
[image2024-3-20\_17-33-24.png](attachments/686065564/686065560.png) (image/png)  
[image2024-3-20\_17-33-56.png](attachments/686065564/686065561.png) (image/png)
