Delete Google Compute Engine instance - google-compute-engine

I am trying to delete an instance from GUI web tool. It is showing that the instance have been deleted and it is removed from the list. Also the desk have been deleted. But after some time it is coming back in the list. Can some one please tell me what is the issue ?
Thanks!

As mention on my previous comment, if you have installed any of the click to deploy software packages in GCE, you need to delete the cluster in the same page.
If this is not the case, in the Developers Console, the 'Operation' option, provides information of instance being created and by whom. This can give you an idea on what is sniping back the instance. If is's a service account, you need to find the script that is creating the instance and stop it.

Related

Executing SSH commands from Google Apps script

I'm trying to create a Google apps script that adds a new user to a Ubuntu vm that I've created whenever a form is submitted. I'm wondering if there is some way to initiate an ssh connection from a Google apps script that would allow me to login to the vm and create a new user. I have the IP and login credentials for the vm. I've set it up so that the script will run whenever a form is submitted, however I'm not sure where to go from there. I apologize in advance if there is a better way to do this, I could just manually create the accounts based off form submissions, but I really need the automation. If there is a solution to this, even if it doesn't involve ssh, I would really appreciate the help!
This is not trivial.
Google AppsScript does not support SSH by default, so you have to work around that.
The user Perhaps you see this name has given you a great idea. I'll further explain how to do what he suggested below:
What you will need on the linux machine
A web service, callable from the google IPs (you can white list it or leave it open to the public (which is dangerous, and should be done only as last resort)).
A account with user creation permission on linux.
A script to create the new users from the data received on the web service.
For the first part, you can do this with any technology you want. I recommend Node.Js + Express.js, as it is easy to create what you want with child processes.
I'll assume you already have an user account able to create users. You probably want to use that.
The last part is just another linux command. You can just Google it and you'll find lots of examples.
There is one catch, while the real-time user creation option with APIs might look enticing to you, I would strongly advise against leaving a public service for something like creating users, as that could become a security risk.
What you might want to do instead is to have a machine with no value (AKA a cheap machine your planned to throw away, with no important data and no confidential information) hosting your web service and then make a script on your Ubuntu VM to fetch the data from said service in an encrypted secure way.

Migrate Cloud Compute VM to Separate Google Cloud Account

Just curious if there's a standard method to take one VM instance and migrate it to a completely different Google Cloud account. If not, I guess I could download all the site files and server configuration files (virtual hosts, apache config, php.ini, etc) but am hoping there's a more streamlined approach.
Just to be clear I have john#gmail.com and john2#gmail.com, both completely separate accounts each with VMs on their respective Google Cloud accounts. I want to move a VM instance from john#gmail.com to john2#gmail.com
I'm open to any method that will get the job done. I like Google's snapshot feature but I have doubts I'll be able to move the specific snapshot over. I'm thinking maybe it'll be possible by creating an image but even that I'm not 100% sure.
Thanks!!
Create a custom image, then share it, then import that image into the target project.

Google compute engine not initialized on new project

I have started a new project on google cloud but I am unable to use the compute engine. I'm getting the following message even after 6-7 hours.
Error Google Compute Engine is not ready for use yet in the project.
It may take several minutes if Google Compute Engine has just been
enabled, or if this is the first time you use Google Compute Engine in
the project.
Is there something I am missing or there is a problem?
I deleted the project and created a new and it worked. Also the old one is stuck on pending deletion.
If someone from google wants to take a look, it would be nice to inform me on what happened.
When projects are deleted, it take a few days before the project is permanently deleted. About what happened, it could be that when the project was created the project wasn't provisioned correctly, causing this issue, but you solved it by creating a new project.

Restoring to a known state

Couchbase CLI comes with the cbbackup and cbrestore commands which I had hoped would allow me to take a database in a known state and back it up and then restore it somewhere else where only a newly installed instance exists. Unfortunately it appears that the target database must have all the right buckets setup already and (possibly) that the restore command requires that each bucket name be mentioned explicitly.
This wouldn't pose too much of a problem if I were hand-holding the process but the goal is to start a new environment in a fully automated fashion and I'm wondering if someone has a working method of achieving this goal.
If it where me, I'd use the CLI, REST API or one of the Couchbase SDKs to write something to automate the creation of the target bucket then do the restore.
REST API:
http://docs.couchbase.com/couchbase-manual-2.5/cb-rest-api/#creating-and-editing-buckets
CLI:
http://docs.couchbase.com/couchbase-manual-2.5/cb-cli/#couchbase-cli-commands
Another option you might look into is to use these same kinds of methods to automate set up of uni-directional XDCR from the source to the target cluster.

How to manage mysql databases created in Azure?

Azure websites let us configure our site using a new MySQL Database instead of SQL Azure. But after creation it's never visible in admin panel. I beleive that it's because is hosted in a third party server, but I have no idea how to reach it, any tip?
For managing it from an external tool check out my response here.
Though the database is hosted by a third party (ClearDB), you should see it listed as a "linked resource" on the dashboard for your Web Site in the Windows Azure portal. When you delete the Web Site, it asks if you also want to delete the linked resource.
If you choose not to or you unlink the MySQL resource explicitly, it's still there and you'll see it a list of existing resources when you subsequently do an explicit link. (I haven't found a way to see a list of the unlinked MySQL databases, but will update this response when I hear).
So I'd say to delete the MySQL database you can
Delete the entire Web Site and, when prompted, select the MySQL database to be deleted too
Unlink the MySQL database from the Web Site you want to keep; create a new temp Web Site, and add the existing MySQL database as a Linked Resource to it. Then delete the new, temp Web Site along with the linked database. Not elegant, but seems to work in my testing.
Currently you can't manage the MySQL Server.
As for being third party - yes, the service (MySQL-as-a-Service) is provided by a third party byt lives in Azure! It is not on other servers, it is on the Azure servers. Most probably (just my guess) worker roles. But as the feature is still preview, the management is missing.
The third party vendor is ClearDB. They provide MySQL as a service on top of Windows Azure. so no worries, your data is in the same Data Center (of course if you chose same) as your web site. But you can't directly manage it, unless you install something like PhpMyAdmin on your website.
I had a slightly different issue where Jim O'Neil's #2 didn't fully work because the database that was orphaned was created through the "Add-On" gallery. To work around this, you can link the orphaned database to the new temporary site as suggested, and then click on the "Manage" link in the Linked Resources tab with the database selected. This will take you to ClearDB's management for the databases.
From there, you can click on the first tab, and then click "Delete" to manually delete the database from ClearDB. This is an async operation so it may take some time, and you may also have to refresh the portal because the entries are cached.
You can also add the ClearDB Add-on and create either the Free tier or the 9.99 a month Venus 1gb tier. The Free tier is only 20mb so that isn't much. For the database name, you can type in the existing MySQL database, and ClearDB Add-on will link to that.
I know this is a super old question, but it's the first result that came up when I did a Google search for deleting mysql azure databases. You can manage your MySql databases from the management portal now, via the Linked Resources page. Either click on the name of the mysql DB directly, or select the row and click manage down at the bottom.
i know that this is a late answer but i followed them to gain the exact access
Select Your web app
Clicked linked resources
Click on mysql db name (It will redirect you to cleardb website for your account)
Install mysql workbench
click on endpoint information
in mysql workbench give the value of hostname, and access credentials i.e. username, password
and you are good to go :)