Is it possible to install packages in a running instance without restarting the instance in gcp using rest api. I tried startupscript but it does the job only after a system restart.
You may rerun a startup-script without having to restart the VM instance by following these instructions in the GCP documentation. However, you would have to connect to the VM instance through SSH.
Regarding the REST API, there is no GCE Rest API to install packages inside the VM, however feel free to open a feature request for this on the Google issue tracker.
Package installations are done through generic Linux commands.
Related
I created multiple (say 16) AWS EC2 ubuntu instances such as:
I want to keep these instances to have the same settings for later jobs. My question is how I could manage them jointly. For example, how could I install Docker in all of them at once and so that I can use docker swarm?
Ideally you would actually configure the server build before you deploy the 16 instances.
You would launch a fresh Ubuntu server and install all of the software on it with its configuration. Once all software is installed you'd create an AMI. When you go to launch the 16 servers you'd go ahead with launching them from your AMI instead of the Ubuntu image.
To follow best practices you'd not do this installation by hand, instead using a configuration automation tool such as Ansible, Chef or Puppet to configure the server to your liking.
You can make use of aws user data to install same software on all the instance during ec2 creation.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html
I'm trying to set up a web development environment on Amazon Workspaces running Amazon Linux AMI, but I didn't find a way to install Vagrant on the machine. I would like to have a virtual webdev machine for various practical reasons, but it seems that I can't run vagrant as AWS is already virtualised.
Is that correct, or is there a way to install and run vagrant/virtualbox containers on AWS Workspace?
AWS workspaces only offers a limited number of packages within its repo manager, so you won't find vagrant there. But you can manually install the repo using the CentOS download on their website. For example, this worked for me inside my Linux AMI WorkSpace:
wget https://releases.hashicorp.com/vagrant/2.1.2/vagrant_2.1.2_x86_64.rpm
yum install vagrant_2.1.2_x86_64.rpm
Now a WorkSpace is essentially a virtualized environment, so its unlikely you will be able to run a vm inside it - See this.
However vagrant offers a number of providers other than the default - including aws, which will allow you to spin up a vagrant box on an ec2 instance rather than locally. You can install it as follows:
vagrant plugin install vagrant-aws
And follow the configuration steps here
I am working on infrastructure automation using Ansible scripts. I installed Tableau Server 10.2 on EC2 instance manually. It requires you to accept terms and asks for registration. Out of the box Tableau doesn't support silent install, at least I didn't find anything on their forums. Has anyone tried automating the installation of Tableau Server?
I would start with the Quickstart CloudFormation scripts that Tableau and AWS have posted here: Quickstart URL.
They have a windows single machine install and a cluster, both of which use a python script to do the silent install. If your looking for the Linux setup, their is a branch with a CloudFormation that does a linux install on a single server.
If your Tableau install requires AD, the documentation out there will say that the Quickstart doesn't support it. However, if you check out the config.yml file used in the quick start and the documentation here it appears you can put in the AD configuration you need in the json file.
In your script, post install, you'll want to copy your backup configuration from s3, and perform a restore using the tabadmin restore backupFile. Most of what the CloudFormation does should be useable in Ansible.
I've got a project setup in Codeship which hooks into my private Github repo, tests and builds. I want to use a custom script to deploy to my DigitalOcean Droplet (VM).
I thought of adding a git remote and using a simple push to the machine using SSH. This was based on the following resource. This fails because I would be pushing to a non-bare repo on the target machine.
Anyone aware of resources or ideas on how to deploy to the VM?
Found on Codeship's documentation that you can use a custom script to run commands using SSH. Instructions are here.
I've written applications making use of the vCloud SDK in the past, and it provided the ability to provide a guest customization script that would be run on the VM when you provisioned. This let me automate VM provisioning from code along with a few per-host customizations, which was great. Since these VMs were running on ESXi, this told me that passing in a script to be run on the VM was a capability of ESXi and the VMWare Tools.
Now I'm working with the vSphere SDK, and I can't a similar capability anywhere. I want to be able to provide a script to my hosts that joins them to my domain, but I can't figure a way to pass a script that does this from the SDK. Is this possible? Or is this capability somehow unique to vCloud?