User Tools

Site Tools


howto-hyperv-ci

This is an old revision of the document!


How to deploy Hyper-V CI in one hour or less

This guide assumes that you already have a MaaS environment set up and working with windows images uploaded. If you do not, head over to How to deploy MAAS, finish that and come back when you are finished.

Prerequisites:

We are going to go through all the steps required to stand up a new Hyper-V CI. At the end of this guide, you should have:

  • one Zuul server
  • one jenkins server configured to connect to zuul
  • one active directory controller
  • various devstack and hyper-v nodes deployed by jenkins jobs

Note, this guide does not cover high availability. That is a topic for a different howto.

Deploying juju

First things first. We need a working juju environment to start things off.

We should strive to use the latest stable juju when deploying a new CI environment. However, if any blocking bugs arise, a bug report should be filed against juju-core. Blocking bugs are usually fixed and backported to stable promptly.

  • adding the juju stable ppa:
sudo apt-add-repository -y ppa:juju/stable
sudo apt-get update && sudo apt-get install -y juju-core
  • create a juju config boilerplate
juju init
  • edit the boilerplate located at $HOME/.juju/environments.yaml and set the following configuration:
maas:
      type: maas
      maas-server: 'http://<ip>/MAAS/'
      maas-oauth: '<Key you got from http://<MAAS IP>/MAAS/account/prefs/>'
      bootstrap-timeout: 1800
      enable-os-refresh-update: true
      enable-os-upgrade: true
  • switch to MaaS environment
juju switch maas
  • bootstrap juju
juju bootstrap --debug --show-log

:!: If you have any troubles bootstrapping and you need to retry, you have to destroy the environment and run the above command again:

juju destroy-environment maas --force -y
  • check your environment
juju status --format tabular

You should see something like:

ubuntu@ubuntu-maas:~$ juju status --format tabular
[Services] 
NAME       STATUS EXPOSED CHARM 

[Units] 
ID      STATE VERSION MACHINE PORTS PUBLIC-ADDRESS 

[Machines] 
ID         STATE   VERSION DNS               INS-ID                                                         SERIES HARDWARE                           
0          started 1.24.3  likable-rock.maas /MAAS/api/1.0/nodes/node-ad58279e-1aab-11e5-bdef-d8d385e3761a/ trusty arch=amd64 cpu-cores=16 mem=32768M 

Deploying the infrastructure

First things first, we need to deploy jenkins and zuul. Jenkins charm exists upstream, and we will use it. The zuul charm is a bit custom made for this CI, so we need to clone it our github repository.

So lets clone necessary charms locally:

mkdir -p ~/charms/trusty && cd ~/charms/trusty
git clone https://github.com/cloudbase/zuul-charm.git zuul
howto-hyperv-ci.1438785850.txt.gz · Last modified: 2015/08/05 17:44 by gsamfira