Total Pageviews

Sunday 3 July 2016

全自动装机工具 OSinstall

“CloudBoot”(OSinstall)云装机平台,是金融云初创公司杭州云霁科技推出的一款X86服务器全自动装机工具,遵循Apache协议,完全开源免费。
“CloudBoot”中文名为云启装机平台,简称云装机,寓意是”云端装机,云之开始”,有以下两层含义:
对已经使用云计算的公司,实现物理机的全自动安装,是构建云的第一步。  

对没有使用云计算的公司,全自动构建物理机资源池,像创建虚拟机一样方便的安装物理机,是未来迈向云计算架构的第一步。


-------------

Prerequisites

You will need the following things properly installed on your computer.

1.Initialization DB

  • Install Mysql
yum install mysql-server
service mysqld start
chkconfig mysqld on
  • Import Data
mkdir -p /usr/yunji/
cd /usr/yunji
git clone https://github.com/idcos/osinstall-server.git
mysql -uroot < /usr/yunji/osinstall-server/doc/db/idcos-osinstall.sql

2.Deploy Server

  • Install Go
#Download the latest stable version source code
wget https://storage.googleapis.com/golang/go1.4.2.src.tar.gz

#Copied to the user's work directory
cp go1.4.2.src.tar.gz /home/<USER>/

#Unzip
tar xf go1.4.2.src.tar.gz

#Compile
cd go/src/ && ./make.bash
  • Configuration environment variable
vim ~/.bashrc
#Append
export GOROOT=~/go
export GOPATH=~/golibs
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
Restart terminal
  • Install gb tool
go get github.com/constabulary/gb/...
  • Deploy Server
cd /usr/yunji
git clone https://github.com/idcos/osinstall-server.git
cd /usr/yunji/osinstall-server/
Configuring database connection:
vim bin/idcos-os-install.json
"repo": {
    "connection": "user:password@tcp(localhost:3306)/idcos-osinstall?charset=utf8&parseTime=True&loc=Local"
},
Configuring PXE config directory:
"osInstall":{
    "pxeConfigDir":"/var/lib/tftpboot/pxelinux.cfg"
}
Build and run
gb build
cd ./bin/
./os-install-server
Test
#Then visit the test url:
http://localhost:8083/api/osinstall/v1/device/getNetworkBySn?sn=xxx&type=json

#Output:
{
  "Content": "",
  "Message": "record not found",
  "Status": "error"
}

3.Deploy UI

cd /usr/yunji
git clone https://github.com/idcos/osinstall-ui.git
cd /usr/yunji/osinstall-ui/
npm install
npm install -g ember-cli
npm install -g bower
bower install
ember server --proxy=http://localhost:8083/

4.Visit your app at

http://localhost:4200/#/dashboard/main

from 

idcos/osinstall