0

Hi I am new to google cloud. I want to use autoscaling. My question is that is it possible to use the image of my current vm as template? Or do I have to create a fresh vm instance and create script that will install all the required setups like apache, php mysql git and pull the source code from bitbucket.

Thank you,

2 Answers2

0

Yes, you can create an instance templates based on an existing instance. Note the warning:

Warning: If the existing instance contains a static external IP address, that address is copied into the instance template and might limit the use of the template.

However such an template needs to be stateless. So including your MySQL database is not a good idea. Also note that you would need to create a new template with every release you make so it might be a good idea to put git related tasks into a startup script. Check this tutorial for a walk through.

Henrik Pingel
  • 9,380
  • 2
  • 28
  • 39
0

Thank you Henrik for clearly explaining everything. I have already moved mysql database to Cloud SQL. For the release related data I too was thinking about add startup script that will update the code with git commands. Really appreciate your help.