How to run official elasticsearch vagrant boxes - elasticsearch

Where can I find documentation for elasticsearch vagrant boxes? Or how should I use them?
Boxes: https://atlas.hashicorp.com/elastic
I did execute these vagrant commands:
vagrant init elastic/ubuntu-16.04-x86_64
vagrant up --provider virtualbox
Expected elastic search to be running inside virtual box.

Expected elastic search to be running inside virtual box
yep, why ? Its nowhere said that elasticsearch will be running in the VM (and if running, which version, which setup) - although it might be cool
Those boxes are mainly used for elastic (as the company) to run their own test. You find more information about that in their github repo
https://github.com/elastic/elasticsearch/blob/master/TESTING.asciidoc#testing-scripts
and an example of the Vagrantfile they're using
https://github.com/elastic/elasticsearch/blob/master/Vagrantfile

Related

Is it possible to enable WinRM in a Modern.ie VM or Vagrant Box by repackaging it with Packer?

There are these free like free beer virtual machines (VM) from Microsoft which one can download from modern.ie and use for testing or whatever. And there is this nice Gist on Github which explains how to enable WinRM support on that VMs. Unfortunately this requires manual interaction with the VM after initial boot up (step 2. in Gist). Is it possible to let Packer do this job using it´s builder type virtualbox-ovf (VIRTUALBOX BUILDER (FROM AN OVF/OVA))? If it is possible can you provide some example code, please.
Or asked another way: How to create a Vagrant Box from an existing VirtualBox image (.ova file) or from an existing Vagrant Box (.ovffile) with Packer?
What you asked is described in Step 4
Package
Since there's a lot of Windows specific configuration, you can include
the Vagrantfile in the package command so winrm and virtualbox
configuration get's default values when the repackaged is used for
other purposes. Remember to run the command in the same directory the
Vagrantfile resides:
$ vagrant package --output "yourboxname" --Vagrantfile Vagrantfile
After that you're all set!
once you complete step2 and 3, you will run step4 which recreate a vagrant box from the updated VM and you can re-use this box
Or asked another way: How to create a Vagrant Box from an existing VirtualBox image (.ova file) or from an existing Vagrant Box (.ovffile) with Packer?
This is not possible, shortly speaking, packer creates Vagrant box from OS ISO distribution, not from existing VM
You can connect to Windows modern.ie VM with ssh (Openssh service runs at startup). You'll have a very limited shell, but enough to call cmd.exe or powershell, and activate WinRM. On Windows 10 VM, you just have to change the network type to something not public. That's it.

Convert vhd to vagrant box?

I have a number of windows VMs running on my hyper-v instance I want to turn into vagrant boxes. Its there a tool out there that can do this for me or a clear guide on what needs to be enabled on the machine and how to create the config files that go into the box?
The documentation for windows VMs coming from hyper-v seem to be lacking with most guides focusing on virtual box.
TIA
There is no direct approach to achieve what you want.
NOTE: remove the hyper-v integration tools (agent, PV drivers etc...).
First, you need to convert VHD to VMDK or VDI format using VBoxManage, for example from VHD to VDI -> VBoxManage clonehd source.vhd target.vdi --format VDI
Once done, create a VM in VirtualBox with a proper spec (# of vCPUs, Memory, etc.), use the existing converted .vdi file as its virtual disk.
Try to boot the VM and see if everything works as expected. Install the VirtualBox Guest Additions (recommended).
Configure the VM as per Vagrant Documentation (e.g. NAT port forwarding rules, disabling UAC etc., refer to Creating a Base Box)
Package it as Vagrant box vagrant package --base vbox_vm_name --output /file/to/name.box

Vagrant creating another VM instead of boot up the default VM

I'm using Vagrant on Windows to create my dev environment. But today when I start it with the command vagrant up, it created another VM instead of using the one I always used it.
Looking in the folder C:/Users/My_User/VirtualBox VMs I found the default VM files.
How to proced to make Vagrant recognize this default VM?
PS: Sorry for my bad english!

Installing Kubernetes on mac with vagrant and virtualbox

This is my first attempt to install and use Kubernetes. I am trying to install an environment on Mac for developing my own apps and deploying them for test locally with Kubernetes. I am familiar with using Vagrant, VirtualBox and Docker for the same purpose. When I saw this page https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/vagrant.md I assumed it would be trivial. I executed these lines:
export KUBERNETES_PROVIDER=vagrant
curl -sS https://get.k8s.io | bash
This created a master VM and a Minion, but Kubernetes seems to have failed to start on the master. On the master /var/log/salt/master is full of python Traceback errors, like this:
2015-07-17 22:14:42,629 [cherrypy.error ][INFO ][3252] [17/Jul/2015:22:14:42] ENGINE Started monitor thread '_TimeoutMonitor'.
2015-07-17 22:14:42,736 [cherrypy.error ][ERROR ][3252] [17/Jul/2015:22:14:42] ENGINE Error in HTTP server: shutting down
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cherrypy/process/servers.py", line 187, in _start_http_thread
self.httpserver.start()
File "/usr/lib/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 1824, in start
raise socket.error(msg)
error: No socket could be created
Vagrant is version 1.7.3. VirtualBox is version 4.3.30
Have I made an obvious stupid mistake?
I don't yet know the fix but I know what is going wrong since it happens to me as well:
OS X 10.10.3
Vagrant 1.7.4
VirtualBox 4.3.30
Kubernetes 1.0.1
When I run the default configuration of this (which creates one "master" and one "minion" VM) I see that the static IP address is not being assigned to the "eth1" interface, and I also see that the Salt API server is sitting in what appears to be an infinite retry loop because it is trying to listen on that IP address.
Also, the following message happened during boot:
[vagrant#kubernetes-master ~]$ dmesg | grep eth1
[ 9.321496] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
So basically, the static IP address didn't get assigned because eth1 wasn't ready when the system first booted, and Salt is waiting for it to get assigned.
I could fix this after boot by sshing to the box using "vagrant ssh" and running the command:
sudo /etc/init.d/network restart
on each host.
This "fixes" eth1 by assigning the static IP address, and after that Salt begins to do its thing, installs Docker, boots various containers, and so on.
What I don't know is how to make this work every time without manual intervention. It appears to be some sort of a race condition between Vagrant and VirtualBox.
If you just want to kick the tires with Kubernetes, I'd recommend installing boot2docker and then following the Running kubernetes locally via Docker getting started guide. Once you are comfortable interacting with the Kubernetes API and want a more complex local setup, you can then work on installing Vagrant.
If the Vagrant instructions aren't working, you should also feel free to file a bug in the github repository.
The tutorial pointed by Robert is realy easy to run. Just change the version to 0.21.2 (maybe 0.21.3 works too).
Else, if you prefer a vagrant solution, try with pires cluster on vagrant. It runs with almost nothing to change.
Running Kubernetes inside VirtualBox requires 4 networks and some adjustments to the configuration:
The VirtualBox HOST ONLY network will be the network used to access the Kubernetes master and nodes from the Mac or PC.
The NAT Network to download packages from the Internet.
The internal connections between Kubernetes PODs uses a tunnel network TUN
The Kubernetes Cluster IP Network is a private IP range used inside the cluster to give each Kubernetes service a dedicated IP
Vagrantfile needs to pass the node public IPs to the Ansible roles that configure Kubernetes to set KUBELET_EXTRA_ARGS environment variable with the public IP of each node (required for reading logs using kubectl).
NodePort needs to be used to publish applications running inside the Kubernetes cluster as Load Balancers are not available in VirtualBox.
See the full example and download the code at Building a Kubernetes Cluster with Vagrant and Ansible (without Minikube), it has been tested in Ubuntu but should work on a MAC as well.

cannot use the box created with packer post-processor vagrant

I followed the tutorial on packer.io to create a vagrant box from an amazon-ebs backed instance : https://www.packer.io/intro.
Only issue, the created .box file only contains a Vagrantfile and metadata.json, but I cannot find out how to use this in vagrant with virtualbox since all other boxes I have seen (among them hashcorp/precise32) have a .vmdk and .ovf file and mine doesn't !! Anyone has followed the tutorial and can advise me ? Thanks,
I think I found out : the vagrant box created for post-processing is meant to be used with the vagrant-aws plugin, not with virtualbox.
The provider is then "aws" and not "virtualbox", hence why I do not get the .vmdk and .ovf files. The aws-plugin is only to boot and provision EC2 instances, where as what I wanted to do was to "capture" the Amazon minimal linux interface in order to test it locally (cannot find a bloody iso file for it).
I must then surrender, packer.io was my last hope : I cannot find a way to set-up a VM with the minimal amazon linux image running...

Resources