GCP Nested VM Installation + Troubleshooting tips

Recommended Posts

Guest

Guest

This guide is directed to those attempting to set up Codius on a rented VM Google Cloud server using CentOS7!

As of patch 1.2.0, all rented VM servers must be a proper “nested vm image” (1.2.5 seems to fix this issue for most servers, but its better to have a nested VM server for performance!)

In this guide, we will cover how to do this and even set up a brand new Codius host from scratch!

If you’ve updated from an earlier patch (1.1.3) to (1.2.1) then you can check your existing server to see if it needs this fix. You may do this by visiting your info page (https://super.reliablecodi.us/info) and checking for this line ("selfTestSuccess":true,)If you see this then you may notice that your Codius host has no issues. Server uptime and Service uptime should be consistent, but if ("selfTestSuccess":false,) then you are stuck in a self-test loop, which will constantly generate new pods and make it look as if you’re actually being used for contracts, but it is just your host creating test pods and timing out with them. In addition to being loaded full of contracts, your SERVER uptime will be however long your server has been running, but your actual SERVICE uptime will constantly be “a few seconds” viaCodius Hosts!

Another way we can test to see if your server’s compute engine has VT-X enabled (nested virtualization) is by loading up your server command shell via SSH, using

Quote

sudo su

to root in, and then typing

Quote

grep -cw vmx /proc/cpuinfo

If the result comes back 0, then you are not nested into the server.(You're running a virtual machine, inside of a virtual machine!) If it comes back 1, you are good to go.

After patch 1.2.0, a self-test was implemented to insure the necessary performance needs for those that built pods to launch onto a host. At this point, we will follow Denario Research and their video to create a VM nest image.

1) Creating a VM Nest Image isn’t as hard as you think it is. First of all, we need to download Google SDK tools and follow the prompts after installing and launching gcloud. It will ask you for basic information such as your google account to establish your connection to the server. Once prompts are followed, you should be left with a command line shell to be used. https://cloud.google.com/sdk/

(OPTIONAL) If you have a previous Codius host, with payment channels, you may want to take the time to close them out to insure a fresh and speedy install with little to no issues ahead! You can do this by accessing your server via “SSH” and begin with this code

Quote

sudo su

(this gives us root)

Quote

moneyd xrp:cleanup

(this will allow you to see your payment channels, select and close it down. Take note, the expiry takes an hour duration, so you will have to wait an hour before closing it out completely. This process needs to be repeated after 1 hr so that the 10 XRP will be released back into your account, until the next payment channel is created.)

Now that SDK is installed, we are prepared to create our VM Nest Image, so let’s go to Google Cloud Compute Engine, highlight your server for Codius and select “stop server”. Using Google SDK we will create the new server rather than using the Compute Engine web-page.

Be sure to follow the bolded and underlined portions of the code to follow. You will have to insert your own server name, and the correct server zone that you wish to use. These zones can be found here ( Google Zones and Regions )

In your Google SDK tools shell, this is the first line of code we need to input. Make sure to change Disk1 to be your server name and the zone you want it in!!!

It may take just a moment, but once it is finished you will see a new image created , but not yet implemented. You can go back into Google Cloud Compute Engine and delete your old server now that the new image is created.

Once the instance is created, you should be able to see the new server in your GCP instances! Go ahead and select the server, and stop it once more to edit the server settings (by clicking on the name of it) Here, we need to enable http/https traffic, open ports 443/80/3000/7768, set your IP to static, or select a static IP that you’ve already chosen. Once you have accomplished this, you may save your settings and restart the server.

SSH back into the new server, and retype the code

Quote

grep -cw vmx /proc/cpuinfo

If your VM nesting image worked, then it should now be a “1” instead of a “0”

Congratulations, your nested VM server (the base of everything) is now created and in place! You can proceed to install your Codius manually, or by using the Codius-Install.sh method (which I HIGHLY recommend, it makes the entire thing such a breeze!)

Also, you should know that if you intend on using the codius-install.sh from Github to install Codius, all of the changes are already implemented into the new setup process. As soon as I propagated my new acme challenges TXT's (I changed my server name) my server was up and running upon the final restart of the process with no extra work needed.

Are you ready to install Codius using the incredibly simple Github script?! Let's do it!

It'll load up a Codius self-installer, which makes the process VERY simple. Follow the process, input your secret key to link with a payment channel, and then once it comes down to the Certbot and applying the information into your DNS TXTs, I advise that you wait 45 minutes before you proceed in the certbot steps to finish the TXT files. It takes 45 minutes to 1HR for DNS propagation throughout the world. If you choose to not wait and try to blast through it, you will be forced to start over again as the installer cannot contact your server and verify the TXT files (because they're not there yet.)

Once you make it through the process, and you've successfully set up your DNS and all of your IP's ping great, the installer should finish with no issue and your server should be up and running.

These can be used to check for errors, and to see if your services are running.

Quote

moneyd xrp:info

moneyd xrp:cleanup

info will show your payment channels and unpaid balances, and you can cleanup your payment channels using cleanup (keep in mind that if you need to do this, you must wait 1hr for your payment channel to expire and then you can fully close it to reclaim your 10XRP for that payment channel.)

Share this post

Link to post

Share on other sites

Guest

Guest

I'm running mine from a self hosted VirtualBox machine and getting the false result. Is there settings to fix this?

You might need to look into VirtualBox itself and see how to enable virtual nesting, could be a setting but I've never messed around with that.

Edit: I'm doing a bit of research of running my own VM on my PC, and it looks like Virtualbox does not support nested VM. What we're essentially doing here with our servers, is running a virtual machine, inside of a virtual machine, which can host another virtual machine. INCEPTION!

Share this post

Link to post

Share on other sites

Guest

Guest

My method is strictly for setting up a VM through Google Cloud services. I am not sure of the implications of what you have to do to set up a barebones server; nor do I know about the "8." I do know that you will require a static IP from your ISP if they provide one, as well as having ports 80 and 443 open for traffic (html and ssl.)

Share this post

Link to post

Share on other sites

Guest

Guest

Google SDK will be utilized on your normal working PC, as it connects to the google cloud platform via networking and you signing into it. When you create the VM image through SDK, you create it through google cloud services for their instances.