How to Create a Machine Image from VM in GCP?

Create a Machine Image from VM:     





  1. Go to Google Console:


— Compute Engine

— VM Instances

— Create one VM instance1

— Disk size 10GB

— Advance option

— Disks

— Add new disks

— Disk source type             — Blank disk

— Disk settings                   — Balanced persistent disk

— Choose disk size


— Now Go to “Machine Images” 


— Create Machine Image

— Name                                            — machine-img

— Source vm instance                      — instance1

— Location                                       — Regional 

— Create 


— Now Go to the Machine Image 

— Create instance 


— Test





Using Cloud shell:  



gcloud compute machine-images create machine-image-name --source-instance=source_vm_name --source-instance-zone=us-central1-a



— Now Create instance from Machine Image 


gcloud beta compute instances create vm_name --zone=zone_name --source-machine-image=machine_image_name --machine-type=e2-standard-2


 






🙏 thanks

 


































Previous
Next Post »