Create a Custom Image and Use It for VM Creation
Create a custom image from a configured VM and launch new instances from it.
Login to your google account.
Go to Compute Engine and create a virtual machine having a startup script.
Check this link for step-by-step instructions on creating a VM with a startup script
https://gaurisblog.hashnode.dev/create-a-vm-with-a-startup-script
For creating an image, we must stop the running instance
Click on three dots and select Stop


Now, click on images from left hand-side pannel

Click on create image

Name the image, select source disk as your recently created vm

Click on create
Your instance image is ready

Now, click on this instance image as we will create a new instance using this image

Click on “CREATE INSTANCE”
Name the instance, allow HTTP traffic under Firewall and click on create

Your instance is ready

Click on this External IP, you will be able to see that startup script which we added in the virtual machine “gauri-instance”

“You've successfully created a custom image and launched new instances from it—well done! This powerful skill lets you replicate and scale your VMs with ease. Keep up the great work. Stay tuned!”