# Expand specific resources of a container

You can expand the container's resources dynamically without deactivating the container. These include:

* Add and remove memory and network resources.
* Modify the IP addresses.
* Extend the network subnets.
* Limit the WEKA system bandwidth on the container.

Adhere to the following guidelines when expanding specific resources:

* Run the relevant `weka cluster container` command with the specific `container-id` you want to expand. Once you run the command, the container is staged to update in the cluster.
* To view the non-applied configuration, run the `weka cluster container resources <container-id>`command.
* To apply changes on a specific container in the cluster, run the `weka cluster container apply <container-ids>` command.  It is possible to accumulate several changes on a container and apply only once on completion.
* To apply changes in the local container, run the `weka local resources apply` command.
* Once the apply command completes, the last local configuration of the container successfully joined the cluster is saved.
* If a failure occurs with the new configuration, the container automatically reverts to the last stable configuration. To view the last stable configuration, run the `weka cluster container resources <container-id> --stable` command.&#x20;

## Modify the memory

Run the following command lines on the active container:

```
weka cluster container memory <container-id> <capacity-memory>
weka cluster container apply <container-id>
```

<details>

<summary><strong>Example</strong></summary>

To change the memory of `container-id 0` to 1.5 GB, run the following commands:

`weka cluster container memory 0 1.5GB`

`weka cluster container apply 0`

</details>

For more details and options, see [#9.-configure-the-memory-optional](https://docs.weka.io/4.1/install/bare-metal/weka-system-installation-with-multiple-containers-using-the-cli/using-cli#9.-configure-the-memory-optional "mention").

### Release hugepages on each container

After reducing the memory allocation for a container, it is required to release the hugepages on each container.

Perform the following steps for each container:

1. Obtain the `release_hugepages.sh` script below and copy it to the `/opt/weka/` folder.
2. Change the script mode: Run `chmod a+x release_hugepages.sh`
3. Stop the container locally: Run `weka local stop`
4. Release hugepages: Run `weka local run /opt/weka/release_hugepages.sh`
5. Restart the container locally: Run `weka local start`

{% file src="<https://1916840177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUYL9RLgSDAkF2U90csR%2Fuploads%2FRbaVPc7kifVmj0TaCjzO%2Frelease_hugepages.sh?alt=media&token=42d14eb4-2fad-4c9b-b7c0-0f82899f8656>" %}

## Modify the network configuration

Run the following command lines on the active container:

```
weka cluster container net add <container-id> <device>
weka cluster container apply <container-id>
```

<details>

<summary><strong>Example</strong></summary>

To add another network device to `container-id 0`, run the following commands:

`weka cluster container net add 0 eth2`

`weka cluster container apply 0`

</details>

For more details and options, see [#6.-configure-the-networking](https://docs.weka.io/4.1/install/bare-metal/weka-system-installation-with-multiple-containers-using-the-cli/using-cli#6.-configure-the-networking "mention").

## Modify the container IP addresses

Run the following command lines on the active container:

```
weka cluster container management-ips <container-id> <device>
weka cluster container apply <container-id>
```

<details>

<summary><strong>Example</strong></summary>

To change the management IPs on `container-id 0`, run the following commands:

`weka cluster container management-ips 192.168.1.10 192.168.1.20`

`weka cluster container apply 0`

</details>

The number of management IP addresses determines whether the container uses high-availability (HA) networking, causing each IO process to use both containers' NICs.

A container with two IP addresses uses HA networking. A container with only one IP does not use HA networking.

If the cluster uses InfiniBand and Ethernet network technologies, you can define up to four IP addresses.

## Add CPU cores to a container

Adding CPU cores to the cluster can only be done on a deactivated container.

For more details and options, see [#8.-configure-the-cpu-resources](https://docs.weka.io/4.1/install/bare-metal/weka-system-installation-with-multiple-containers-using-the-cli/using-cli#8.-configure-the-cpu-resources "mention").

## Expand SSDs only

Adding SSD drives can alter the ratio between SSDs and drive cores.

#### Procedure

1. Ensure the cluster has a drive core to allocate for the new SSD. If required, deactivate the container and then add the drive core to the container.&#x20;
2. Determine the relevant container ID by running  the command:\
   `weka cluster container`
3. Scan for new drives by running  the command:\
   `weka cluster drive scan`
4. Depending on the architecture, use the following instructions to add the SSDs:&#x20;
   * [Legacy architecture](https://docs.weka.io/4.1/install/bare-metal/weka-system-installation-with-multiple-containers-using-the-cli/using-cli#7.-configure-the-ssds)&#x20;
   * [Multiple container architecture](https://docs.weka.io/4.1/install/bare-metal/weka-system-installation-with-multiple-containers-using-the-cli#6.-configure-the-ssd-drives)

## Modify resources on a local container

You can also modify the resources on a local container by connecting to it and running the `local resources` command equivalent to its `weka cluster` remote counterpart command.

These local commands have the same semantics as their remote counterpart commands. They don't receive the `container-id` as the first parameter. Instead, they operate on the local container.

{% tabs %}
{% tab title="Available commands on an active container" %}
You can run the following commands dynamically on an active container:

`weka local resources [--stable]`

`weka local resources apply`

`weka local resources net`

`weka local resources net add`

`weka local resources net remove`

`weka local resources memory`

`weka local resources bandwidth`

`weka local resources management-ips`

`weka local resources dedicate`
{% endtab %}

{% tab title="Available commands on a deactivated container" %}
First, deactivate the container by running the `weka cluster container deactivate` command and then you can run the following commands:

`weka local resources failure-domain`

`weka local resources cores`
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.weka.io/4.1/usage/expanding-and-shrinking-cluster-resources/expansion-of-specific-resources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
