Increase Root Volume Size in Google Cloud Instances

You can resize persistent disks when your instances require more storage space and attach multiple secondary disks only when you need to separate your data into unique partitions. Increase root volume size in Google Cloud Instances in the console or GCloud command line without instance reboot.

Now, to the cases where you will need to extend the actual running instance, this disk would be known as a ‘root persistent disk’. You can resize disks at any time, regardless of whether the disk is attached to a running instance.

google cloud disk modify

 

How to increase the root volume size in Google Cloud without reboot

Login to the GCP console

Step 1

  • Go to the Disks page to see a list of persistent disks in your project.
  • GO TO THE DISKS PAGE
  • Click the name of the disk that you want to resize.

or

  • Go to Compute Engine-> VM instances page
  • Click your Instance
  • Click Root Volume under Boot disk and local disks section

Step 2

At the top of the disk details page, click Edit.

In the Size field, enter the new size for your disk. Boot disks and secondary disks with MBR partition tables can resize only up to 2 TB.

Step 3

At the bottom of the disk details page, click Save to apply your changes to the disk.

After you resize the disk, you must resize the file system so that the operating system can access the additional space.

Gcloud Command

In the gcloud tool, use the disks resize command and specify the –size flag with the desired disk size in GB.

gcloud compute disks resize [DISK_NAME] –size [DISK_SIZE]

where:

[DISK_NAME] is the name of the disk that you are resizing.
[DISK_SIZE] is the new size for the disk in GB. Boot disks and secondary disks with MBR partition tables can resize only up to 2 TB.
After you resize the disk, you must resize the file system so that the operating system can access the additional space.

Example 
# gcloud compute disks resize my-instance --size 100GB

Step 4

Login to the Instance

Check with disk size using fdisk -l

# sudo fdisk -l

If the disk that you want to resize has a partition table, you must grow the partition before you resize the file system. Use growpart to resize your image partition.

# sudo yum install cloud-init cloud-utils-growpart

sudo growpart /dev/[DISK_ID] [PARTITION_NUMBER]

# sudo growpart /dev/sda 1

Step 5

we used resize2fs because /dev/sda1 was using ext4 file system format. In the case of XFS, we will use xfs_growfs command instead of resize2fs.

resize2fs can be used to resize ext2, ext3, and ext4 file systems

sudo resize2fs /dev/[DISK_ID][PARTITION_NUMBER]

# sudo resize2fs /dev/sda1

If you are using XFS file system, then use below xfs_growfs command

sudo xfs_growfs /dev/[DISK_ID][PARTITION_NUMBER]

# sudo xfs_growfs /dev/sda1

You have done, use the df command to verify that the file system is resized.

# sudo df -h /dev/sda1
 

vCenter services stop, start, or status command in windows

If your vCenter is on a Windows host, then you must use Windows commands to restart the VMware vSphere web client service in vCenter. There are many ways to restart services in vcenter and troubleshooting purposes, it is required to restart the VMware vCenter Server services such as VMware Virtual Center Server, VMware vSphere Web Client, or VMware Directory Service.

VMware vCenter Server 6.x, VMware recommends to use the vSphere Web Client or Service Control command-line tool to stop, start, or restart vCenter Server. These commands are verified with VMware vCenter Server 6.x and steps to restarting the vSphere web client service in Windows.

How to stop, start and status vCenter services command in Windows server.

1. Log in as an administrator to the windows server that is running vCenter Server.

2. Open an administrative command prompt.
Run this command to change to vCenter Server and/or Platform Services Controller installation directory:

3. Go to default vCenter server installation path

cd C:\Program Files\VMware\vCenter Server\bin

Run this command to list vCenter Server and/or Platform Services Controller services

./service-control --list
 

Run this command to view the current status of vCenter Server and/or Platform Services Controller services:

./service-control --status

Run this command to stop all services:

./service-control --stop --all

Run this command to start all services:

./service-control --start --all

To perform a dry run of the command, This displays the actions that command run without executing the actions.

./service-control --start --all --dry-run

Run this command to stop a specific service:

service-control --stop servicename

Run this command to start a specific service:

service-control --start servicename

 

Example

service commands

vCenter service control commands

 

Errors:

A server error occurred.
[500] SSO error: Cannot connect to the VMware Component Manager https://vcentera.vmusketeers.local/cm/sdk?hostid=8f7ab780-bbd2-11e7-8d6f-2cc260268d52
Check the vSphere Web Client server logs for details.

 

vCenter Errors

To solve this you have to restart the Component Manager and the Web client from the command line, both which are unavailable from the services.msc.

Go to the installation path of your vCenter server:

cd C:\Program Files\VMware\vCenter Server\bin

stop and start Component Manager services

service-control --stop VMwareComponentManager
service-control --start VMwareComponentManager

stop and start the web client service:

service-control --stop vspherewebclientsvc
service-control --start vspherewebclientsvc

 

 

 

Configure Email Alerts in VMware vCenter

The monitoring of VMware vSphere should be a combination of proactive benchmarking and reactive alarm-based actions. vCenter Server provides both methods to help the administrator keep tabs on each of the virtual machines and hosts as well as the hierarchical objects in the inventory. Using both methods ensures that the administrator is not caught unaware of performance issues or lack of capacity. How to Configure Email Alerts in VMware vCenter.

vCenter comes with a few default alarms such as ESX host connection state and usage alarms. Use the following steps to create alarms and how to send email notifications.

Make sure you have the permission to edit this vCenter configuration

In the vSphere Web Client,

  • navigate to the vCenter Server instance.
  • Click on the Manage tab.
  • Under Settings, select General.
  • Click Edit.

email notification

  • Select Mail.

In Mail server,

  • type the SMTP server information.

The SMTP server is the DNS name or IP address of the SMTP gateway to use for sending email messages.
Example,
smtp.gmail.com

In Mail sender,

  • type the sender account information.

The sender account is the email address of the sender.
Example,
[email protected]

  • Click OK.

Now as you have successfully configured the email settings in vCenter.

To test the mail settings, create an alarm that can be triggered by a user action, such as by powering off a virtual machine and check the emails.