...
- Start with a new project name for all resources used with MayaNAS either for evaluation or production use.
# 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 gcloud compute networks subnets update default --add-secondary-ranges range1=10.9.0.0/24
Create 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.
# gcloud --project $PROJECT compute disks create mayadata-disk --size=2TiB --type=pd-ssd
Create compute instances
Code Block language text theme EclipseConfluence # 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 #gcloudgcloud --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 and proceed with MayaNAS installation and configuration.