Coder Social home page Coder Social logo

razor-vagrant-demo's Introduction

razor-vagrant-demo

TODO

Auto configurations failed

  1. NPM for node.js
  2. mime and [email protected] packages of node.js (with --registry=registry.npm.taobao.org)
  3. set agent1 network to host-only type manually

Mongodb service cannot start

If it happens, razor will not work. This always caused by VM not been shutdown gracefully. Try the solution as follow.

  • ssh to VM
  • delete mongodb.lock file at /var/lib/mongodb/
  • restart mongodb service

Host OS is Windows

  • care line ending on Windows, it's recommended to run git config --global core.autocrlf false
  • puppet cannot work as a gem on windows, install puppet by windows installer instead.
  • librarian-puppet gem depends on puppet gem, so won't work under windows either.
  • Vagrant-wrapper not work proper on windows, use dalang's fork instead.
  • tftp service not running: service tftpd-hpa restart

A demo of Razor using Vagrant.

Demo

This is a demo using Vagrant of Puppet Lab's Razor introduction.

Step 1: Setup

First install VirtualBox and the VirtualBox Extension Pack. Next bundle & boot the servers:

$ bundle install
$ bundle exec rake start

The gold server will boot first and kick off a puppet run. This will install razor and setup dhcp on the internal VM network. Once the gold server finished the agent1 box will boot. agent1 initially fails to PXE boot because razor is not configured with a microkernel.

MicroKernel Missing

Step 2: Register a MicroKernel

$ bundle exec rake microkernel

The microkernel rake task downloads and registers the razor microkernel. At this point agent1 will boot the microkernel.

MicroKernel Console

The agent1 server will register itself with razor. We can inspect it via the razor node command.

$ bundle exec vagrant ssh gold
$ sudo su -
$ cd /opt/razor
$ bin/razor node

razor node

The razor node attributes command will show the attributes of agent1.

$ bin/razor node attributes ...

razor node attributes

Step 3: Register an OS

Run the ubuntu rake task to download and register Ubuntu Precise 12.04 Server with razor. This may take a while.

$ bundle exec rake ubuntu

List the registered OS images via razor image.

$ bundle exec vagrant ssh gold
$ sudo su -
$ cd /opt/razor
$ bin/razor image

razor image

Step 4: Create a Model

Add a model for ubuntu\_precise with the new image.

$ bin/razor model add template=ubuntu_precise label=install_precise image_uuid=...

razor model add

Step 5: Add a Policy

Create a policy to install ubuntu on agent1.

$ bin/razor policy add --template=linux_deploy --label=precise --broker-uuid=none --tags=virtualbox_vm --enabled --model-uuid=...

razor policy add

Step 6: Ubuntu

On the next checkin by agent1 the server will reboot. Instead of booting the microkernel, razor serves agent1 the Ubuntu installer.

Ubuntu Installer

Once that finishes you can login as root with your password.

Ubuntu Console

Step 7: Cleanup

Run vagrant destroy to cleanup everything.

$ bundle exec vagrant destroy --force

razor-vagrant-demo's People

Contributors

benburkert avatar chrislundquist avatar dalang avatar lynxbat avatar patux avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.