From cbd4766242bca323f693b19ea89f2f6b2d0f0498 Mon Sep 17 00:00:00 2001 From: tei-k Date: Wed, 23 Sep 2020 15:18:41 +0900 Subject: [PATCH 1/4] Add documentation about how to resize azure managed disk --- docs/HowToExpandAzureManagedDisk.md | 82 +++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 docs/HowToExpandAzureManagedDisk.md diff --git a/docs/HowToExpandAzureManagedDisk.md b/docs/HowToExpandAzureManagedDisk.md new file mode 100644 index 000000000..b026ee679 --- /dev/null +++ b/docs/HowToExpandAzureManagedDisk.md @@ -0,0 +1,82 @@ +# A Guide on How to Expand Managed disk in Azure + +This guide explains how to expand managed disk in Azure. + +## Stop processes + +Stop the processes of a node that you want to expand the disk of. + +For example in a Cassandra node, do as follows. + +```console +$ sudo systemctl stop cassandra +``` + +## Stop the VM (or Detach disk from VM) + +Follow [the guide](https://docs.microsoft.com/en-us/azure/devtest-labs/devtest-lab-attach-detach-data-disk#detach-a-data-disk) + +## Resize the disk + +Follow [the guide](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#expand-an-azure-managed-disk) + +## Start the VM (or Attach the disk) + +Follow [the guide](https://docs.microsoft.com/en-us/azure/devtest-labs/devtest-lab-attach-detach-data-disk#attach-a-data-disk) + +Note that the `LUN` must be chosen with appropriate value when using `Atttach disk` + +- `5` is for Cassandra data disk or Monitor log disk. +- `6` is for Cassandra commitlog disk. + +## Expand a partition + +Follow [the guide](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks#expand-a-disk-partition-and-filesystem) + +```console +$ sudo systemctl stop cassandra +$ sudo xfs_growfs /dev/xxx +``` + +## Start the processes + +Start the processes of a node that you expanded the volume of. + +For example in a Cassandra node, do as follows. + +```console +$ sudo systemctl start cassandra +``` + +## Do the above operations on each node in the same cluster + +Since `scalar-terraform` manages a set of nodes in a cluster (e.g. Cassandra cluster) in the same way, it is not allowed to change the resource configuration of only part of the nodes. So please update all the nodes in the same cluster in the same way. +For example, if you update the volume size of a Cassandra node from 1TB to 2TB, you need to update the volumes of the other Cassandra nodes to 2TB as well. + +## Update tfstate + +Since the above operations are done manually without using terraform, the actual states of cloud resources and tfstate are not consistent after the above steps. Please do the following to update tfstate to make it consistent with the actual resources. + +First, update the tfvars of a terraform module of a resource that you updated to match with the actual states of the resource. +For example, if you update the size of a data volume of Casssandra node to 2TB, please do as follows. + +```console +$ vim your.tfvars # the filename is environment dependent + +## add only the `data_remote_volume_sizeĀ = "2048"` line if there is already a cassandra block. +cassandra = { + data_remote_volume_sizeĀ = "2048" +} +``` + +Second, do `terraform plan` to check if Cloud resources' states are the same as what you are planning to apply. + +```console +$ terraform plan -var-file=your.tfvars +``` + +Third, do `terraform refresh` to update tfstate. + +```console +$ terraform refresh -var-file=your.tfvars +``` From 24b5ac1d8b22ae6443716c3c8b8f3905fe324741 Mon Sep 17 00:00:00 2001 From: Hiroyuki Yamada Date: Thu, 24 Sep 2020 11:25:02 +0900 Subject: [PATCH 2/4] Update docs/HowToExpandAzureManagedDisk.md Co-authored-by: Yusuke Morimoto --- docs/HowToExpandAzureManagedDisk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/HowToExpandAzureManagedDisk.md b/docs/HowToExpandAzureManagedDisk.md index b026ee679..5a9cc24da 100644 --- a/docs/HowToExpandAzureManagedDisk.md +++ b/docs/HowToExpandAzureManagedDisk.md @@ -24,7 +24,7 @@ Follow [the guide](https://docs.microsoft.com/en-us/azure/virtual-machines/linux Follow [the guide](https://docs.microsoft.com/en-us/azure/devtest-labs/devtest-lab-attach-detach-data-disk#attach-a-data-disk) -Note that the `LUN` must be chosen with appropriate value when using `Atttach disk` +Note that the `LUN` must be chosen with appropriate value when using `Attach disk` - `5` is for Cassandra data disk or Monitor log disk. - `6` is for Cassandra commitlog disk. From cd1e769812b6e858b1102698752eed774bc1c3a3 Mon Sep 17 00:00:00 2001 From: Hiroyuki Yamada Date: Thu, 24 Sep 2020 11:25:09 +0900 Subject: [PATCH 3/4] Update docs/HowToExpandAzureManagedDisk.md Co-authored-by: Yusuke Morimoto --- docs/HowToExpandAzureManagedDisk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/HowToExpandAzureManagedDisk.md b/docs/HowToExpandAzureManagedDisk.md index 5a9cc24da..c165426ba 100644 --- a/docs/HowToExpandAzureManagedDisk.md +++ b/docs/HowToExpandAzureManagedDisk.md @@ -58,7 +58,7 @@ For example, if you update the volume size of a Cassandra node from 1TB to 2TB, Since the above operations are done manually without using terraform, the actual states of cloud resources and tfstate are not consistent after the above steps. Please do the following to update tfstate to make it consistent with the actual resources. First, update the tfvars of a terraform module of a resource that you updated to match with the actual states of the resource. -For example, if you update the size of a data volume of Casssandra node to 2TB, please do as follows. +For example, if you update the size of a data volume of Cassandra node to 2TB, please do as follows. ```console $ vim your.tfvars # the filename is environment dependent From 3e0c568cb95de66688ad81b29edeea05fbcf71de Mon Sep 17 00:00:00 2001 From: Hiroyuki Yamada Date: Thu, 24 Sep 2020 11:25:15 +0900 Subject: [PATCH 4/4] Update docs/HowToExpandAzureManagedDisk.md --- docs/HowToExpandAzureManagedDisk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/HowToExpandAzureManagedDisk.md b/docs/HowToExpandAzureManagedDisk.md index c165426ba..49bb2b04c 100644 --- a/docs/HowToExpandAzureManagedDisk.md +++ b/docs/HowToExpandAzureManagedDisk.md @@ -1,4 +1,4 @@ -# A Guide on How to Expand Managed disk in Azure +# A Guide on How to Expand Managed Disk in Azure This guide explains how to expand managed disk in Azure.