Compute Engine VM instance group got wiped out? - google-compute-engine

I'm new to GCE and want to migrate my web site there. I created a VM instance group hoping. I installed all the packages and set it up a couple days ago. But today I noticed my VM instance group has a different name (postfix, to be exact), and the disk is flushed empty. Is it possible to restore its status, or at least make sure it won't get wiped out again? I'm so surprised that GCE wiped out everything and I wonder if I'm missing something during setup.
A few details in case they are related:
I'm using a trusty image for the VM.
The cloud storage is chosen to be a regular persistent disk.
It was working with emphemeral IP, and yesterday I started to use Cloud DNS to host my domain. I should have used a static IP, but that mistake shouldn't cause the VM instance group to be flushed...
I'm using cloud sql as the database service.
Maybe I should just use VM instance, given I don't have much traffic now?
Any help will be greatly appreciated~

Related

Creating a Staging VM in Google Compute Engine

I'm trying to set up a Staging VM for a site that's in production that I have just inherited. The site is running Wordpress/Woocommerce and has not been updated in a while. The VM it's hosted on is running an old version of PHP. Obviously, this all needs to be fixed up but I'm unfamiliar with GCP Compute Engine. Also any attempt to run backup/clone plugins crashes the site and requires a restore from the daily snapshot which is very annoying.
Is it possible to clone the VM/disk to a new instance, point that at a temporary domain, and test/update the site? I have been trying to do this for a while now without much luck any suggestions would be much appreciated. Thanks.
Creating a clone of an existing VM is possible and quite easy.
Create a snapshot of the VM. If possible stop the VM before doing this to ensure 100% accuracy - this way you will have exact snapshot of the drive without any errors. You can do it while the VM is running too if stopping it is out of the question.
Create a VM from the shapshot - select as a boot disk a snapshot that you've just created. Remember to assign a static public IP to this VM (unless you want it changed after VM restart and since you're going to do some configuration this would likely happen). You can change the VM's specs at this time too - nothing stops you from adding/removing CPU's, RAM etc. It may well be that your VM is underutilised and you can use something smaller to save costs. Or the opposite.
Start the machine. Now you can modify your WP configuration to point to a new domain. Depending on the SSL certificate - you can either use external one or the one provided by GCP (most convinient solution).
If you already own a domain you want to use for staging you can host it in Cloud DNS or at some other provider - just point it to the external IP you just reserved.
If you will be hosting your domain in the Cloud DNS then you will find necessary infomration in the documentation about managed zones (domains).
You can also consider creating a new VM and setting it as a template for creating a group of VM's (managed autoscaled group) and creating an external HTTPS load balancer in front of it. But this adds a little to the complexity so it's just my idea if you needed to handle a lot more traffic.

AWS EC2 instance created from AMI don't works (Error 504) - WEBb don't run

I'm new on AWS but I read a lot of documentation to create, launch and image instances. Now I have a client that use AWS and have 2 instances EC2 runing commercial web sites (using Nginx and MySQL in Amazon RDS and Wordpress).
I need to create clones of this websites to have a Q.A. ambient. I try creating images from these instances and launching new instances with this, but this don't work. When I Try to visit the website clone using the IP of the instance, that shows a 504 error. (The idea is to have two instances ready to use with the same website. One for visitors use and another to do testes, updates, changes or to use when the another instance crash)
The on-air website domain is ibser.org, and the new instance domain (runing now) is link to instance
Somebody may give me info that what can I do?
#Wilmar Sometimes it do happen as you have created the image successfully but due to manual setup you have to start the services inside the Instance manually.
As per the link provided, its showing 504 Gateway time out, so please check with the Security group of your newly created Instance and sometimes A corrupt WordPress database may also trigger a 504 gateway timeout error. This means may be your mysql service is not running.
So my suggestion is SHH into your New instances and check with all the required services which all need to be in running state and do check with the database.

Dynamic ip address in minishift causes problems to spin up

I recently installed minishift, the openshift origin environment built on docker on my laptop. The instance works fine at the first time when installed. However, when I poweroff my machine and then try to start the system again, it fails.
The issue is the ip address assigned while provisioning the VM first time changes when the system is restarted.
The issue doesn't persist when I delete the VM and then start it again. What's the solution for this? I have tried several possible solutions provided on the internet.
I have also tried --host-only-cidr "192.168.99.1/24" to minishift while starting it for the first time. But that didn't help either.
I have found the solution. Though it requires using a third party script, currently there's no provision to assign static ip to Virtualbox VMs. I have used the library https://github.com/ahilbig/docker-machine-ipconfig and performed the steps followed, which provide a static ip address for minishift. The command is
minishift-ipconfig static <your_ip_address>
Please note the ip address should be the same which was assigned while creating the VM.

Google Compute Engine Group Intance keeps changing IP address

I have a google VM Instance Group setup so I can use autoscale (currently turned off until I'm ready to load test) when traffic/requests increase. I'm running a standard LAMP stack to run CraftCMS.
For some reason, the static IP address keeps changing making it unavailable to update via SSH through the console. When the IP changes, my LAMP stack is gone and I have to reinstall everything.
I tried claiming a static ip address and applying it to the VM Instance but that seems to do nothing.
How do I setup a Managed Group instance so this stops happening. If the ip address keeps changing, how can I setup the A Name DNS settings so that when you go to the actual URL it points to the correct server?
It all seems to work fine when I don't setup a Managed Group Instance but a regular VM Instance. But I want autoscaling to be on so I don't have to manually manage it.
Any help with this would make my day...

Can I install MySQL on the VMs provided in Azure Cloud Services?

From what I gather, the only way to use a MySQL database with Azure websites is to use Cleardb but can I install MySQL on VMs provided in Azure Cloud Services. And if so how?
This question might get closed and moved to ServerFault (where it really belongs). That said: ClearDB provides MySQL-as-a-Service in Azure. It has nothing to do with what you can install in your own Virtual Machines. You can absolutely do a VM-based MySQL install (or any other database engine that you can install on Linux or Windows). In fact, the Azure portal even has a tutorial for a MySQL installation on OpenSUSE.
If you're referring to installing in web/worker roles: This simply isn't a good fit for database engines, due to:
the need to completely script/automate the install with zero interaction (which might take a long time). This includes all necessary software being downloaded/installed to the vm images every time a new instance is spun up.
the likely inability for a database cluster to cope with arbitrary scale-out (the typical use case for web/worker roles). Database clusters may or may not work well when a scale-out occurs (adding an additional vm). Same thing when scaling in (removing a vm).
less-optimal attached-storage configuration
inability to use Linux VMs
So, assuming you're still ok with Virtual Machines (vs stateless Cloud Service vm's): You'll need to carefully plan your deployment, with decisions such as:
Distro (Ubuntu, CentOS, etc). Azure-supported Linux distro list here
Selecting proper VM size (the DS series provide SSD attached disk support; the G series scale to 448GB RAM)
Azure Storage attached disks being non-Premium or Premium (premium disks are SSD-backed, durable disks scaling to 1TB/5000 IOPS per disk, up to 32 disks per VM depending on VM size)
Virtual network configuration (for multi-node cluster)
Accessibility of database cluster (whether your app is in the vnet or accesses it through a public endpoint; and if the latter, setting up ACL's)
Backup / HA / DR planning
Someone else mentioned using a pre-built VM image from VM Depot. Just realize that, if you go that route, you're relying on someone else to configure the database engine install for you. This may or may not be optimal for what you're trying to achieve. And the images may or may not be up-to-date with the latest versions, patches, etc.
Of course, what I wrote applies to any database engine you install in your own virtual machines, where a service provider (such as ClearDB) tends to take care of most of these things for you.
If you are talking about standard VMs then you can use a pre-built images on VMDepot for that.
If you are talking about web or worker roles (PaaS) I wouldn't recommend it, but if you really want to you could. You would need to fully script the install of the solution on the host. The only downside (and it's a big one) you would have would be the that the host will be moved to a new host at some point which would mean your MySQL data files would be lost - if you backed up frequently and were happy to lose some data then this option may work for you.
I think, that the main question is "what You want to achieve?". As I see, You want to use PaaS solution with Web Apps or Cloud Service and You need a MySQL database. If Yes, You have two options (both technically as David Makogon said). First one is to deploy Your own (one) server with MySQL and connect to it from the outside (internet side). Second solution is to create one MySQL server or cluster and connect Your application internally in Azure virtual network. WIth Cloud Service it is simple but with Web App it is not. You must create VPN gateway in Azure VM and connect Your Web App to this gateway. In this way You will have internal connection wfrom Your application to Your own MySQL cluster.