Google Cloud Platform (GCP) provides rich set of resources for building true enterprise-class NAS server readily. Please note that the network bandwidth is tied to the number of cpu cores of the compute instance. The storage IOPS is based on capacity of provisioned storage. Please refer to google Google cloud documentation for detailed configuration steps.
Purpose | Machine | Cores | Memory | Network | Storage |
---|---|---|---|---|---|
Shared block storage for IP-SAN or NVMeoF | n1-highcpu-4 | 4 | 3.6GB | ~8Gbps | pd-ssd Mirrored ephemeral NVMe |
Capacity Optimized NFS server LVM + VDO + XFS + NFS Server | n1-standard-4 | 4 | 16GB | ~8Gbps | Bcache(writeback) on pd-ssd Data on pd-standard ssd:standard ratio 1:4 |
High Performance NFS Server | n1-standard-8 | 8 | 30GB | ~16Gbps | Bcache uses pd-ssd Data on pd-std |
All Flash NFS server ZFS Storage Appliance | n1-highmem-32 | 32 | 208GB | ~40Gbps | Data & Log uses SSD Persistent Disk (pd-ssd) |
High-Availability | IPAliases feature of GCP |
Here is the sequence of steps involved in deploying High-Availability (HA) MayaNAS on Google cloud platform. The next steps assume you’ve already created a project, and installed gcloud
. You can check that gcloud
is installed and authenticated by running:
gcloud info
In this tutorial we will assume we are planning on deploying All Flash NFS Server configuration with
- 2 compute instances
mayanas1, mayans2
- 2TB pd-ssd persistent storage
- Default network for the internal
- Virtual IP: 10.9.0.10
- Start with a new project name for all resources used with MayaNAS either for evaluation or production use.
#gcloud# gcloud create project maya-eval-proj
MayaNAS requires a service account with sufficient permissions to manipulate disk attachments for proper sharing and fencing, and also storage read-write access to object storage. It also needs sufficient permission to float the virtual IP across multiple instances. By having separate service account for all MayaNAS deployments you can enforce proper security measures as the assigned roles are limited to this project instance only.
# gcloud iam service-accounts create maya-gce-account --display-name "mayanas service account"# gcloud iam service-accounts list
The output will contain the EMAIL of the newly created service account. Load them into shell environment variables which will be used in the next steps
PROJECT=$(gcloud info --format='value(config.project)')
SA_EMAIL=$(gcloud iam service-accounts list --filter="displayName:$SERVICE_ACCOUNT_NAME" \ --format='value(email)')
Add relevant permissions to the newly created service account with the role scope limited to this project only. Your other instances in different projects will not be affected by these changes.
# permission to create/modify instances in your project gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:$SA_EMAIL \ --role roles/compute.instanceAdmin # permission to create/modify network settings in your project gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:$SA_EMAIL \ --role roles/compute.networkAdmin # permission to create/modify firewall rules in your project gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:$SA_EMAIL \ --role roles/compute.securityAdmin # permission to create/modify images & disks in your project gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:$SA_EMAIL \ --role roles/compute.storageAdmin
Google cloud brilliantly engineered way to provide floating IP addresses on cloud. We will make use of that to assign virtual ip addresses in 10.9.0.0 net.
#gcloud compute networks subnets update default --add-secondary-ranges range1=10.9.0.0/24Create persistent storage of size 2TB and of type pd-ssd in the default zone configured with gcloud. Consult Google Cloud documentation for cost and availability in your zone.
Based on the above table plan on compute and storage instances and create them accordingly. For example
# gcloud --project $PROJECT compute disks create mayadata-disk --size=2TiB --type=pd-ssdCreate compute instances
gcloud --project $PROJECT compute instances create mayanas-ha1 --machine-type n1-highmem-32 --metadata=serial-port-enable=1 --image-project centos-cloud --image-family centos-7 --service-account=$SA_EMAIL --scopes compute-rw,storage-rw --network-interface '
gcloud --project $PROJECT compute instances create mayanas-ha2 --machine-type n1-highmem-32 --metadata=serial-port-enable=1 --image-project centos-cloud --image-family centos-7 --service-account=$SA_EMAIL --scopes compute-rw,storage-rw --network-interface 'Once the instances are ready and login to the instances using ssh shell to proceed with MayaNAS installation and configuration.