0:03 [Music]
0:05 hello hi everyone Welcome to Cloud
0:08 Sprint hope you are doing good today as
0:09 we are progressing in the course of the
0:12 CPS I thought there are few topics which
0:14 are really important by working on cloud
0:17 as well as for the exam also you might
0:19 expect two to three questions from this
0:21 video in your exam or picks which we are
0:23 gonna cover are custom machines
0:25 permittable VMS
0:29 images and snapshots these four topics
0:31 are very important while you work with
0:33 compute and while you Design Systems in
0:36 your respective job or career so let's start
0:37 start [Music]
0:43 while so you have two options while
0:45 creating a compute instance number one
0:48 are standard configuration machines and
0:49 second is custom machine types custom
0:51 machines are basically where you can
0:54 choose how much CPU versus how much
0:57 memory you want you need and any need is
0:59 not being fulfilled by the standard
1:01 machines we go ahead with custom
1:03 machines and then we choose the CPU and
1:06 memory the benefit of this is mostly
1:08 around cost you don't invest resources
1:11 suppose you need 20 GB of memory you
1:13 will choose 20 GB of memory you won't
1:17 you are not gonna use 480 GB of memory
1:20 custom machines from via API as well
1:22 that's very very simple command when we
1:24 do gcloud commands I'll showcase this
1:26 apart from that it all it supports
1:30 almost all the OS okay you can create
1:32 you can programmatically access and
1:34 assign how much custom memory or custom
1:36 CPU won't give and you can create it on
1:38 the Fly well let's check it at the lab
1:41 okay let's let's check it now you
1:43 already know how to create VMS I'm just
1:44 gonna show you how to make custom
1:46 machine and uh there is machine family
1:49 for different different purpose then
1:51 there's series and then there's machine
1:53 type when you select the series comes
1:55 with standard predefined resources okay
1:58 like N1 into standard 2 into standard
2:00 High meme
2:04 into N2 M2 these kind of options you
2:07 have okay suppose if I choose this I
2:10 have 96 GB of CPU 96 GB of memory if I
2:14 choose this then I have 4GB of CPU and
2:17 16 GB of memory I cannot change this but
2:19 suppose this is a requirement you are
2:21 running a memory hungry process you need
2:24 less CPU but much much more memory than
2:26 offered what you'll do the one solution
2:28 could be use a higher configuration this
2:30 higher configuration will give you more
2:33 CPU more memory but you'll waste the resources
2:34 resources
2:37 as a cloud engineer you should make sure
2:39 that you're optimizing the cost you're
2:41 saving the money while creating
2:43 resources to solve this problem gcp
2:45 gives us an option of creating custom machines
2:46 machines
2:49 okay here you can adjust with N2 series
2:51 custom machine you can have
2:56 up to 80 vcpus and up to 650 GB machines
2:59 the more memory you want to increase
3:02 you can save the price changing
3:06 okay you can see the more CPU you are
3:09 shifting this number is increasing okay
3:11 to compensate that so suppose you need
3:15 as I mentioned you need less CPUs and
3:17 more memory so what you can do you can
3:20 keep your vcpu to 36 and increase the
3:24 memory to 288 GB okay this is where how
3:27 you are saving money on CPU and you are
3:31 utilizing the memory of the VM to the
3:33 maximum extent and you are saving on
3:34 money as well if you would have gone
3:37 with a default default value you can see
3:40 this 1400 will become
3:43 2200 right so straight away lot of
3:46 saving for monthly if you calculate this
3:48 money yearly it will be lot of money and
3:50 these processes you'll be running day in
3:52 and day out so you can see the
3:55 difference why custom machines are very
3:56 very powerful rest of the process
3:59 remains same so you can just go ahead
4:01 click create this will create a VM I'm
4:03 not creating because that's not
4:05 important you already know how to create
4:07 it we create a VM just note one thing
4:09 this custom option is not available with
4:11 these options like if you go to compute
4:14 optimized there's no custom option
4:16 memory optimized no custom options this
4:19 custom option is only available with
4:22 general purpose machine and not all of
4:26 them but with E2 N1 N2 n2d these series
4:30 have custom machines options so you
4:32 should always know that how much load
4:34 you're gonna take and that's how you
4:36 configure your machine to save your cost
4:38 that's all about custom machines [Music]
4:44 the second topic is spot VMS or
4:47 permittable VMS primitable VMS are
4:49 highly affordable compute instance
4:52 suitable for for bad jobs or fault
4:55 tolerant workloads so what happens Cloud
4:57 providers have a lot of VMS lying ideal
5:00 they offer those machines at a cheap
5:03 price so you can use it but whenever
5:04 they need them the cloud providers
5:07 whenever they need them they can take it
5:10 away if you're running a bad job where
5:12 time boundation is not a limit okay
5:15 where you you can survive if some node
5:18 is extracted from that cluster if your
5:20 job can survive that then this is one of
5:23 the best way to use discounted rates of
5:26 VM to save lot of money with your
5:30 compute cost if you see spot VMS are 91
5:32 percent cheaper than regular instances
5:35 not always but this is mostly it's very
5:36 very cheap but Cloud providers just want
5:39 to utilize the ideal resources right if
5:41 they can make money even 20 it's better
5:43 than zero percent right it so they offer
5:46 you that thing and if you are running a
5:48 20 node cluster you can have four or
5:52 eight nodes out of 20 those are spot VMS
5:56 and then A14 are standard VMS okay even
5:59 if those 8 goes away your job can still
6:01 survive but still you have to reduce the
6:03 cost of your overall compute right how
6:05 to enable that let's check it to
6:08 understand limitable VMS we'll again go
6:10 back to VM machines
6:13 click on create instance over here
6:16 directly you will go to Advanced options
6:18 inside Advanced options does management
6:22 you come down to availability policies
6:25 you can see the default price
6:27 by default the standard option is
6:30 selected this other option called spot
6:33 okay once you have clicked standard
6:35 which is by default your cost of your
6:37 machine is 25 dollars per month the
6:40 moment you select spot price comes down
6:42 to eight dollars right you can see it's
6:45 Dirt Cheap same VM you're getting at the
6:48 70 of the discount 60 no discounts
6:50 depending how much discount Google is
6:52 offerings the difference is standard is
6:55 ideal for most workloads spot instances
6:58 are discounted instances which are
7:01 underlying on the racks of gcp and it's
7:05 sitting idle so gcp rents it at the
7:07 lower price discounted rates so you can
7:09 utilize the benefit of being on cloud
7:12 right that's the major benefit what gcp
7:16 has gcp gets some money for underlying
7:19 resources which is any anyhow free so
7:21 you can run your fault tolerant
7:23 workloads or some non-critical workloads
7:26 at a very discounted rate spot helps you
7:29 now what is the problem with spot the
7:31 problem with spot is the CP have given
7:35 you the cheaper machines to run as a
7:38 spot instances but if gcp needs those
7:40 machines back they will take it back
7:43 okay that's the only issue this machine
7:47 has when we read make we will understand
7:50 that how we can mix standard and spot
7:53 and then get the sweet spot right and
7:56 then save cost yet run jobs without any
7:58 hindrance once you have selected spot
8:01 after selecting spot you you just need
8:03 to choose that what you want to do on
8:05 termination you want to stop the VM or
8:08 you delete the VM so both are possible
8:12 okay any any case memory is not memory
8:14 is not preserved that's all about spot
8:16 select once you hit create it will
8:20 create a VM with spot instance okay we
8:22 add the discounted rate that's all about
8:29 before you start reading snapshots it's
8:31 very important to understand the storage
8:34 you already have studied about cloud
8:37 storage buckets what are rest of them so
8:40 rest of them are also your disk which
8:42 are attached to your compute zonal
8:44 persistent disk so persistent disk are
8:46 something which are not part of the OS
8:48 while you're creating it you can attach
8:51 it to any VM okay you can take backup
8:53 you can de-attach and then again attach
8:55 to another VM that's the flexibility it
8:57 gives and this can survive your VM
8:59 restarts as well
9:02 that is the point of using persistent
9:04 disks but here you have options of
9:07 Journal zonal persistent disk which are
9:09 very efficient reliable block storage
9:12 then you have Regional persistent disk
9:14 okay this is regional block storage
9:16 replicated in two zones so this is like
9:19 more reliable the first ones one was
9:22 only the first one was only on the zonal
9:25 side the third one is local SSD when you
9:27 have to design some read write solution
9:29 local SSD will give you the best
9:31 performance okay that's the highest
9:34 performance uh disk option you have
9:37 cloud storage is basically object
9:38 storage I have already done a lot of
9:40 videos on that you can go back and check
9:43 that out file store is high performance
9:46 file storage for Google Cloud users okay
9:48 okay you can go back and check when to
9:51 use what what are the benefits of using
9:53 what and these are all these are all the
9:56 options yeah you can just uh choose it
10:00 SSD so local SSD have the the higher
10:02 throughput and lower lower latency than
10:05 standard persistent disk or SSD
10:07 persistent disk okay the data that you
10:09 store on a local SD persist only the
10:11 instance it stopped or deleted right
10:14 that's the risk of using SSD that's my
10:17 use persistent disk but then when you
10:19 have when you need to design a solution
10:21 which have higher throughput and lower
10:23 latency then you go with local SSD and
10:26 perform your all the read operations on
10:27 that SSD because that will give you the
10:29 fastest outcome
10:31 that's all about disks now let's go back
10:34 to snapshots okay snapshots are
10:36 basically incremental backup of your
10:39 data which you are storing in persistent
10:42 disks it is just backing up your disks
10:44 after you create a snapshot to capture
10:46 the current state of the disk you can
10:48 use it to restore your data to a new
10:51 disk so you suppose you are saving some
10:53 sort of data which you want to post it
10:55 which you want to take backup and attach
10:57 to other VM in some other environment
11:00 snapshots will come as a savior right
11:03 find create a snapshot and then attach
11:06 it to it attach the disk to that VM you
11:08 can create snapshots from disks even
11:09 while they are attached to running VM
11:11 instances this is important you don't
11:14 have to stop the VM you can also
11:15 schedule it
11:18 you can also schedule that after every
11:20 end of the day or after every one hour
11:23 create a backup of the disk this will
11:26 help you survive survive any Clash of
11:28 your VMS as well if you have a snapshot
11:31 disk you can quickly create a VM using
11:33 that disk so your data persists this
11:36 this mostly works like a Version Control
11:39 System where only contains the changes
11:41 from the last version not entire full
11:44 snap snapshot so it helps you can also
11:46 delete your snapshot once your work is
11:49 done or you can schedule the deletion in
11:51 a nutshell snapshots are basically to
11:53 take incremental backup of your
11:55 persistent disks and how do you do it
11:57 that in real world let's go at labs and
12:00 check it out okay over here
12:02 to give you an example I have already
12:04 created a VM okay and it has a disk
12:07 attached for this what I'm going to do
12:09 to take a snapshot first of all I'll go
12:12 to snapshot when I go to snapshot I'll
12:14 click on create snapshot the name I
12:17 given is Snapshot backup lab Source disk
12:20 app issues okay this is the name of the
12:23 VM which the the disk and the VM which
12:24 we created
12:27 now I have two type of options to create
12:30 this snapshot first is Snapshot it is
12:32 mainly good for long term backup and
12:34 disaster recovery and second one is
12:37 archive snapshot which is best for cost
12:39 efficient data retention but in this
12:41 example I'm just going to use Snapshot
12:44 but you can also select archive snapshot
12:47 for retaining your data the next one is
12:50 the location okay if you
12:53 want to keep it reasonable okay if you
12:55 keep it reasonable you can just use this
12:58 disc in one location if you keep it
13:01 multi-regional you can move it across
13:03 U.S across Asia across Europe
13:06 okay of course you'll have to pay for
13:09 this but you can save your disk in a
13:13 multi-reasonal location and share it
13:16 with all the zones within us if you do
13:18 it you Europe across Europe
13:21 okay data transfer cost will be there
13:25 but that's the benefit okay I said okay
13:28 do it across Europe the things I
13:31 selected first is the name the source
13:34 disk snapshot multi-reasonal click on create
13:35 create
13:37 you can see successfully created
13:40 snapshot snapshot backup lab now now
13:42 this is this is the backup we have now
13:46 how one should use it okay now suppose I
13:48 have a backup from of the disk which is
13:51 attached to a running VM I want to
13:53 create another VM using it so how can
13:55 you use it first of all let's open this
13:57 here either you can create an instance
13:59 or you can create a disk so we'll create
14:03 a disk we create a disk saying okay this
14:04 is disk one
14:07 Cloud Sprint Cloud Sprint we want to
14:11 keep it in single zone yes fine you just
14:13 let it be save your central disk Source
14:16 type whether it's image snapshots will
14:19 say it's a snapshot the name of the
14:21 snapshot is Snapshot backup lab which we
14:24 just created right now which Disk type
14:27 you have size Let It Be default create a
14:28 disk now
14:31 you can see that disk Cloud spread one
14:32 which we are which we have
14:35 created is being created let's set
14:38 okay so from snapshot backup lab snapshot
14:40 snapshot
14:43 we have created a disc called Cloud
14:46 Sprint the scone Cloud Sprint okay you
14:48 can see the source is Snapshot backup
14:51 lab which which is a snapshot basically
14:55 okay now let's go ahead and create a VM
14:57 using this disk which
15:00 for doing that you'll come to disk
15:02 attach existing disk
15:06 in here you will see that option okay so
15:08 disk One Cloud Sprint you'll see read
15:10 write keep disk safe
15:12 so you're given a name called snapshot
15:16 disk to VM snapshot to disk test VM N1 series
15:16 series
15:20 and uh and in the advanced section we
15:22 choose an existing disk the disk which
15:24 we just created from the snapshot which
15:27 we had taken right you'll click on create
15:29 create
15:31 yes you can see snapshot to disk disk to
15:35 VM VM is also created so technically so
15:37 these two VMS have the same image so
15:41 what we did we created a VM from VMware
15:44 took a snapshot from snapshot we created
15:47 a disk and we created again an instance
15:50 and that attached that disk to this VM
15:52 that the full life cycle we have done
15:54 and that this is how you can take
15:56 snapshots delete it you can also
15:58 schedule a snapshot you can click here
16:02 create schedule snapshot and as I
16:04 mentioned you can choose you want to
16:06 keep it multi-regional or reasonable you
16:09 can have a schedule daily weekly hourly and
16:10 and
16:13 you can also choose when to Auto delete
16:15 snapshots you can configure this date
16:18 and you can create a schedule
16:21 this will everyday take backup as per
16:24 your schedule it will take snapshots and
16:26 save it here and then this can be used
16:30 to create disks and VMS as per the need
16:34 that's all about snapshots [Music]
16:39 the last topic of this video is machine
16:42 image machine images a compute engine
16:44 resource that stores all configuration
16:47 metadata permission and data from
16:51 multiple disks of a VM you can use a
16:53 machine image in many system maintenance
16:55 backup recovery instance loading closing
16:58 scenarios so machine image when you
17:00 create a machine image it will save all
17:02 configuration metadata permission data
17:05 and multiple disks of that particular
17:07 virtual machine and you can create that
17:09 anywhere else if you have a machine
17:12 image available you can quickly create a
17:15 VM in few clicks okay if if your system
17:17 gets crashed you can use the machine
17:20 image and create that VM replace that VM
17:22 if you want to move that VM from Dev
17:24 environment to prod environment you can
17:27 do that as well right let's see with one
17:29 of the example how we can do that I'm
17:31 creating a VM machine image with the
17:34 name machine image Cloud Sprint
17:37 so the VM is created now let's go to
17:40 machine image
17:42 when you go to machine image you can
17:44 create a click on create a machine image
17:46 okay I've given a name Cloud Sprint Dash
17:50 VM backup you can write a description
17:53 source so there's just one VM which is
17:55 running just tweet which we just created
17:58 which is machine image Cloud spread very
18:00 important same concept as snapshot you
18:02 want to keep it reasonable or you want
18:05 to use across reason
18:07 if you do it multi-reasonable you can
18:09 create it for multi reason I'm done
18:10 choosing the location
18:12 once I'm done choosing the location I'll
18:14 click on hit create
18:17 it it will create a machine image from
18:20 that VM for me now you can see Cloud
18:23 Sprint VM backup machine images created
18:26 this particular backup has everything it
18:29 has VM property metadata permission and
18:32 data from all its attached disks this
18:35 can be today used to create an instance directly
18:36 directly
18:39 either you can create it from here or
18:41 you can go to the first page where you
18:45 create a VM click on VM instances you'll
18:48 click on create instance and in here
18:51 instead of choosing new VM what you'll
18:54 do you'll click on new VM instance from
18:56 machine image
18:59 and you'll see this which the backup
19:01 which we just created over here Cloud
19:05 Sprint VM backup right and we click on
19:07 continue once you click on continue so
19:09 once you choose that you can still
19:12 change the name the reason the series
19:14 you can just customize it and then hit create
19:16 create
19:23 yes so this VM is created now from that
19:25 machine image which we created from this
19:28 VM okay from a VM you can create a
19:30 machine image and from using that
19:32 machine image you can create a VM this
19:33 can be used for multiple purpose
19:36 promoting your promoting your VMS from
19:38 one environment to other environment
19:42 taking backups uh you while planning
19:44 your Dr thing this is very very uh
19:46 useful okay that's all I had to cover
19:48 for the exam for machine images
19:50 okay thank you very much for watching
19:51 this video if you're liking the videos
19:53 subscribe to the channel and see you in
19:56 the next one bye [Music]