Google Cloud- New Disk while Creating VM-Redundancy Options - google-cloud-platform

Referencing this as well:https://cloud.google.com/compute/docs/disks/regional-persistent-disk#repd_create_disk
It seems to imply that we cannot directly define the disk as having regional redundancy at time of creation of a VM(no such disk option visible). Only after creation of VM, we need to go to Storage Section and create disk with redundancy option and then attach it to VM.
2.Additionally,with regard to Local SSDs [which are non persistent], looks like we cannot randomly attach them while a VM is running, seems like option below appears only at time of VM creation?:
Kind regards,
Aditya

According to this article [1], regional persistent disk cannot be created as boot disk. And it need to be attached after the VM is created.
And for your second question, yes, you can add local SSD only during VM creation. According to this [2]:
"Local SSDs are located on the physical machine where your virtual machine instance is running, they can be created only during the instance creation process. Local SSDs cannot be used as boot devices"
[1] https://cloud.google.com/compute/docs/disks/regional-persistent-disk
[2] https://cloud.google.com/compute/docs/disks/local-ssd#create_local_ssd

Related

Is volume in aws like a hard drive that the instance uses?

I am learning about aws and using ec2 instances. I am trying to understand what a volume is.
I have read from the aws site that:
An Amazon EBS volume is a durable, block-level storage device that you
can attach to your instances. After you attach a volume to an
instance, you can use it as you would use a physical hard drive.
Is it where things are stored when I install things like npm and node? Does it function like the harddrive o my server?
AWS EBS is block storage volume, and for the ease of understanding, yes you can consider it same as hard drive, however with more benefits over traditional hard drive. few of them are:
You can increase/decrease size of the storage as per your requirement
(Hence name Elastic)
You can add multiple ebs to your instances, for example 20 GB of volume1 and 30 GB of volume2
And for the question you asked if you can install npm & node yes you
can as it would be attached to your EC2 instance and your instance
can easily utilised attached data, modules,etc
For further explanation you can refer this user guide from AWS on EBS: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes.html
Yes it is exactly like a hard drive on your server and you can have multiple devices.
The cool thing is that you also can expand them if you need extra space.
where things are stored when I install things like npm and node
Yes, technically ebs volume is virtual storage drive which is
connected to your instance through network, ( flash drive connected over network).
Since network is involved which implicitly means there will be some latency because of data transfer through network.
The data is persistent even if instance stops,terminates, hibernates or hardware failure.
Since it is network drive it can be attached or detached to any other instance.
Adding to this there is another type of storage which you will find called as instance store
You can specify instance store volumes for an instance only when you launch it. You can't detach an instance store volume from one instance and attach it to a different instance.
it gives very high IOPS because it is directly (physically) attached to instance.
The use case for instance store would where data changes rapidly like for cache or buffers.
Your data will be lost if any of these events happens like The underlying disk drive fails The instance stops, instance hibernates instance terminates or drive failure.

GCP: How to add Local SSD disk to a existing VM instance in google cloud platform

I am working in Google cloud platform and I have a situation where I need to attach local SSD disk to a existing VM machine but I cannot find a way to do it, Basically this is the process I need to do.
1. Attach a new local SSD disk
2. Copy the existing data to new disk
4. Unmount the old disk
5. Mount new disk to old data path
Thanks.
As John said, you can't if you initially created your VM without local SSD. But you can do something like this
Go to the console, select your current VM
Go the the boot disk section and select your boot disk
Create an image of the boot disk
Go back to the current VM page
Click on "create similar" button, on the top
Select the boot disk image that you just created
Add additional disk, with type local scratch SSD
Now you have a similar VM, with the same boot disk image but with local SSD.
Then, you have to detach the existing persistent disk on the old VM and attach it to the new one, make your copy, and delete it.

Is it possible to attach usb to an instance?

Is it possible to attach usb to an instance? Just curious to know if it is possible to attach memory stick or external hard disk on GCP instance
It's not possible to attach USB (or any other storage device that you own) to a GCP VM instance.
Only supported storage solutions are described in the official documentation.
It's possible to attach a local SSD disk but it's just a temporary storage - in case of VM restart (or shutdown) data are lost (in most cases).
You could mount your own USB stick as a samba share but you'd have to run another machine somewhere where you can physically connect it and share it from.

Stop a VM instance in GCP with local SSD attached to it

According to the documentation - https://cloud.google.com/compute/docs/disks/#localssds - it is not possible to stop and instance that has a local SSD. It merely acts as a cache memory.
Is it possible to get a local SSD for an instance which is persistent and allows us to stop the instance?
Also, are local SSDs and persistent SSDs detected as different hardware types by an instance?
At this moment there's no way to setup a GCE instance with a local SSD and be able to stop it, as is mentioned in the documentation this kind of storage is used to store caches and as processing space.
Now, about the hardware differences between a local SSD and a persistent SSD. Since the point of view of the GCE instance they are the same, I mean the instance detects the two of them just as another mount; however, the technology that behind each of them it's completely different.
A local SSD, just as the documentation states, is physically attached to the server where is hosted the instance while a persistent SSD it's just a Log-Structured Volume, in other words it's not a physical hard drive.
There's a complete explanation about how persistent disks works on Google Cloud at [1].
[1] https://www.youtube.com/watch?v=jA_A-OXsIss
WARNING stopping your VM will delete all data from the local disk
You can stop the VM from ssh with the commands
sudo shutdown -h now or sudo poweroff
This is the correct way to stop the VM if it has a local ssd attached.
https://cloud.google.com/compute/docs/instances/stop-start-instance

Google Cloud - Local SSD hadware failure?

We are planning to use Google Cloud Local SSDs, because we need better IOPS than the persistent SSD disk have. We want to build a RAID5 array with 4 disks with mdamd (Linux). My question: how can we manage hardware failure with these disks? We can't unplug these disks, because we don't have phisycal access to the server. If we remove a disk with mdamd and add a new one, will it solve this problem?
Local SSD is an ephemeral storage space and is not a reliable storage method. For example, should the machine hosting your VM suffer from a hardware failure, your data will be lost and unrecoverable. The same is true if you stop the machine on purpose or accidentally.
RAID does not help, as your instance (and Google for that matter) will lose access to the data you stored on Local SSD once the instance stops running on that machine.