Create a VM Using a Predefined Image

Launch a VM from a custom or predefined image.

  1. Create a VM instance and make sure to Allow HTTP and HTTPS traffic

  2. Now, SSH into it and install apache and commands for that are listed below

    • sudo su

    • apt update

    • apt -y install apache2

  3. apache is installed

  4. Close this SSH, and copy your External IP and paste it into the browser

  5. You will be able to see apache2 page that means your apache is successfully installed

  6. Close this page

  7. Now, stop your instance as we are going to create an image of this vm

  8. After that, from the left hand-side pannel, under Storage select Images

  9. Click on Create Image

  10. Name your image, select source and for source-disk select the instance which you have created earlier

  11. Now, click on create

  12. Now, go back to VM instances and here we will create another instance but it’s gonna be little different from the previous way

  13. While creating VM, under Boot Disk section click on CHANGE

  14. Go to Custom Images and select your previously created image

  15. Click on select button

  16. Under Firewall, select Allow HTTP traffic and Allow HTTPS traffic

  17. Click on create button

  18. Now, our instance is ready which we have have created by using custom image

  19. Now, copy the External IP of this newly created instance and hit it in the browser, you will be able to see the apache2 default page which we have intsalled in our previous instance i.e. gauri-instance

    You’ve successfully launched VMs using custom and predefined images! Ready for the next challenge? In the following post, we’ll tackle creating VMs from snapshots. Stay tuned, it’s going to be exciting!