Rackspace/Vagrant: Working with a rackspace vagrant box locally - vagrant

I was reading through Rackspace's article about using Vagrant with Rackspace open cloud which shows you how you can use a vagrant vm that is hosted on a Rackspace server.
I'm wondering if there's any way that I could work from a vm that is provisioned like a Rackspace server on my local machine via Vagrant. I can't seem to find a box specifically for emulating Rackspace servers and I can't find information on what base OS and basic tools rackspace cloud servers actually use so I could provision my own environment.
Is there a place where I can find a rackspace specific vagrant box or at least find out the os info?

Edit:
Correction, it is possible, but it takes a few steps:
Export (from Rackspace) the image that you want to run locally see here for more info
Download image from Cloud Files
Convert/import the vhd file into VirtualBox see this for example
At this point, you should be able to use that image with Vagrant to run a Rackspace image locally.

Related

Remote Vagrant Dev Server

I am a web developer and I am currently using Vagrant + VirtualBox to run my projects. I have a Proliant server at home that I am not using at the moment. I was thinking, is there any way I could use it instead of the VM, so I could run my projects remotely?
P.S: Can you think about any other cool use cases for this server?
Vagrant is design to work with VMs or containers when using a docker provider but not bare metal server simply because the goal is to be able to build, use, destroy and rebuild environment programmatically so using a base-metal server break the main use case.
The possible course of action is to install the hypervisor on your personal server and then configure your Vagrantfile to use the remote provider instead of the local. You'll have as a direct benefit the ability to create a lot of instance since your server will most likely have more resources than your local laptop/desktop workstation.

Remote Access to Linode

Hi I am a cloud Hosting in Linode with 2 different images
using the Remote Access ssh root#149.152.231.117
I always connect to the first image (My Ubuntu 14.04 LTS Profile).
Would be possible to connect to another images ?
You can only boot into one disk at a time. Whichever disk your configuration profile is pointing to, looks like Ubuntu 14.04 in this case, is what you are booting.
You would need to reboot into another disk to run their distro. To have multiple VMs running at the same time would require multiple Linodes.
The exception here is if you choose to boot Ubuntu and then create a Docker container with a different distro. Then you can log into both.

Using vagrant on EC2

I need to setup a web server and a database server on EC2.
It should be easy to migrate to another service provider later.
Currently, I have a web server and a database server, each running on separate EC2 micro instances with software installed there remotely.
Can we run a vagrant box on these micro instances with pre-installed and pre-configured softwares like LAMP stack and use that instead. So I will end with 2 vagrant boxes , one for web server another for database server.
Amazon provides already means to copy an instance but it is copied to another EC2 instance only probably .. If there is need to move to some other provider, it will be same process of re-installing all. So, an own virtual box installed on Amazon's virtual box is what i was looking into..
I don't know how good or bad it is.. I doubt if this will affect performance as well. Please share your views. Target is to have env prepared locally and have flexibility to deploy it on any service provider easily.
Running vagrant inside your AWS box is probably not the right solution. Have you looked into the Vagrant AWS provider?
That will allow you to setup and provision your AWS boxes with Vagrant and Puppet or Chef... if you are using Puppet or Chef to provision your servers then you will have a very portable "scripted" install for your servers that can easily be moved to another provider at a later date...
So running a virtual machine, on another virtual machine probably isn't the best. But if you want to install Vagrant on Amazon Linux you can do:
wget https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_x86_64.rpm
sudo rpm -ivh vagrant_2.2.4_x86_64.rpm
The RPM is the Centos version from the downloads page here: https://www.vagrantup.com/downloads.html
But then you cannot install virtualbox to run a VM. So it doesn't actually work anyways.

Replacing Rackspace Cloud SITES with Amazon EC2 Instances

So at work we run a bunch of sites on rackspaces cloud sites platform. This works alright, except I have no way of tweaking anything server side and I find that they sometimes aren't as responsive as they could be.
Let's assume that most of the sites are bloated wordpress installations.
Would it be possible to use EC2 micro instances to host these? (One instance per site)?
I want to move away from rackspace as I have no flexibility with cloud sites and prefer Amazons services.
Sure! You can easily do that!
Sign up for EC2 here.
Go to http://alestic.com/ and chose AMI (Ubuntu AMIs for EC2 drop-down) you want to start instance from.
Start EC2 Micro Instance by hitting the links (or use API Tools). You can use user-data to install desired software on instance start, but I recommend (for simplicity) just to start Instance and install software via terminal using SSH. Follow the dialog and create RSA key to connect your Instance.
Connect to your Instance over ssh using RSA key.
Install software. For example: sudo su, then apt-get update && apt-get install -y ntp php5-fpm nginx wordpress [...].
Create AMI from running Instance with installed and configured software.
Launch more Instances from your own AMI bundled with Wordpress and stuff!
Full disclosure: I am a rackspace employee.
If you want more flexibility than rackspace cloud sites, then you can use rackspace cloud server. You will have all the flexibility of the cloud. If you like the managed part of cloud sites, then i would suggest managed cloud server.

Create New EC2 Instance with Custom ISO

I'm using Switchvox, an Asterisk PBX and I'd like to host it on EC2.
Digium Switchvox provides an ISO which contains everything needed to host the pbx server: OS, software, etc. It's basically an image of the server.
How do I instantiate a new EC2 instance using the custom ISO they're providing?
From this ISO, you can create either a VMware or VirtualBox image. Form there, you may convert this image into an EC2 AMI image and go from there.
Just make sure you are using the same arch (32 v. 64) and proper kernel.
That being said, you might get into more operations then simply fire up an existing vanilla AMI available from the community. There might be one that closely match your OS requirements.
Overview:
Check pre-requisites
Install your ISO onto VMware vSphere then export as VMDK
Upload your VMDK to an S3 bucket on the same AWS account
Install and configure AWS command line interface (CLI)
Setup a VM Import Service Role
Use the CLI to import the VM from S3 into an Amazon Machine Instance (AMI)
This is a lengthy process, so it's worth reading through the pre-requisites. Pay particular attention to the supported operating systems / Linux distributions and versions.
They clearly state "Note that you can only import VMDK files into Amazon EC2 that were created through the OVF export process in VMware."
For example, you can get a VMDK using VirtualBox, but if you try to import this you might see the following error, when checking the status:
aws ec2 describe-import-image-tasks --import-task-ids import-ami-someid
"StatusMessage": "ClientError: Disk validation failed [Unsupported VMDK File Format]"
However, there is some Oracle documentation on exporting a virtual machine in the Open Virtualization Format (OVF).
If all goes well, you can launch the newly imported AMI as usual.
You can create a VMware virtual machine using your custom ISO and move it from your VMware host to EC2. Read more: VM Import/Export
Only Windows Server 2008 variants can be converted from VMDK to AMI.

Resources