0

After creating an instance group, I started installing software (such as boost) to the first instance in the group. But I do not want to repeat the whole installation process (copy files from local pc, configure, make) for each instance in the group. Is there a way to install software to all instances at once?

Making an image of disk and creating instance group from that disk does not install installed software. Also, only one instance could be created from a snapshot however, I want to create multiple instances.

Grzenio
  • 35,875
  • 47
  • 158
  • 240
Shibli
  • 5,879
  • 13
  • 62
  • 126

1 Answers1

0

One way which comes to my mind as a solution to your scenario is to use startup script. You can store the startup script in a Google Cloud Storage bucket and then provide the URL to the script when creating your instance.

Once the startup script is added, you can simply force rerun the script during runtime of the instance so you don’t need to reboot the instance.

Hope this helps.

Taher
  • 572
  • 2
  • 11
  • Does this mean that in each run I have to reinstall software in all instances? – Shibli Jan 30 '18 at 10:44
  • By **each run** if you mean every time the machine reboots, then the answer is *it depends*. The startup script will always [try to execute when the machine boots up](https://cloud.google.com/compute/docs/startupscript#startup_script_execution) after the network is available but you can remove the script **after the first run**. This will keep the installed software as it is inside the VMs and you will not have to re-install those anymore. – Taher Jan 30 '18 at 22:45