How to set up RackHD demo under Windows (vagrant box)
Prerequisite:
- Ensure your machine has more than 8G physical memory, because RackHD & vNode will use 4G mem. there will be performance impact without enough physical memory.
- Don’t use virtualbox GUI to power on/off/reset the vNode ( quanta_d51). Use vagrant command with “--provision” parameter (vagrant halt -f quanta_d51 , vagrant up quanta_d51 --provision )
Steps
(1) Install vagrant & virtualbox on windows
(2) Create a Vagrantfile (case sensitive ) in Windows
Fill with the content from https://github.com/RackHD/RackHD/blob/master/example/Vagrantfile
(3) Right mouse click the folder where Vagrantfile lives, to launch “git bash here”
(4) In “Git Bash”
- Type “vagrant up dev” or “vagrant up” , to start RackHD VM
- Then, after above completed, Type “vagrant up quanta_d51 --provision”
A virtualbox window will pop up, in which vNode Host OS boot up
You don’t need to interact with it at this moment
(5) Go back to “Git bash”, Type “vagrant ssh dev”, login into RackHD VM
Modify the config.json
Change the authEnabled to false , so that you can use RackHD API without token for easy demo.
Then restart RackHD service (for authEnabled , just need to restart on-http)
Type “sudo service on-http restart”
Or you can reboot the whole RackHD OS .
(6) Wait for a while, RackHD will discover the vNode , and catalogs/bmc works fine
Talk with RackHD
The RackHD 8080 port has been forwarded to your Windows's 9090 port.
(1) talk with API in Windows in Git-Bash
there're 2 ways to use "curl" to talk with RackHD API
one is Login into RackHD server (using "vagrant ssh dev"), and talk with localhost:8080/api/current/xxxx
another is in git-bash (in Windows context), talk with localhost:9090/api/current/xxxx
(2) Swagger UI
You can directly use your Windows web browser to talk with RackHD, exmaple, Swgger-UI
localhost:9090/swagger-ui
(3) On-Web-UI
(3.1) if you are using RackHD < version 2.0.0, you can use Download latest build
Use Git-Bash 'vagrant ssh dev" to login RackHD
cd /var/renasar/on-http/static/http/ sudo wget https://github.com/RackHD/on-web-ui/archive/gh-pages.zip sudo unzip gh-pages.zip sudo mv on-web-ui-gh-pages on-web-ui cd ~
Then you can use http://localhost:9090/on-web-ui/
(3.2) Build On-Web-UI from source code
Use Git-Bash 'vagrant ssh dev" to login RackHD
NOTE: it requires "node version" >=6 to successfully build the src code. (by default in RackHD dev env, node 4.8 can't fully successfully build all the css files.)
cd ~ git clone https://github.com/RackHD/on-web-ui.git cd on-web-ui npm install npm run build # Build `static/monorail.css` & `static/monorail.js` for production.
after above steps, the on-web-ui application will locate under on-web-ui/static folders.
because the RackHD vagrant box is build from deb package, so the HTTP directory is under /var/renasr/on-http/static/http
so now , please copy the on-web-ui application from static folder to HTTP directory with a new name on-web-ui.
sudo cp on-web-ui/static /var/renasar/on-http/static/http/on-web-ui -r
Now you can launch Chrome in your window, with URL "localhost:9090/on-web-ui" to talk with RackHD
Monitor the virtual Quanta’s console
- Install a VNC tool , like UltraVNC, or realVNC
https://www.realvnc.com/download/viewer/
- Then use VNC Viewer (e.x.realVNC) to connect to this 127.0.0.1:5901, like below
( because vagrant forward the port 5901 to Windows’s 15901
quanta_d51: 5901 (guest) => 15901 (host) (adapter 1))
Then you can see the Quanta vNode console
If you see the VNC connection can’t be established at the beginning, please be patient.
It will take about 10-20 seconds between vNode Host OS start up and when VNC can be connected. But if it takes longer, there should be something wrong.
Use ‘vagrant reload quanta_d51 --provision’ to restart
FAQ:
If RackHD didn’t find any node, and the VNC screen is shown as below:
tftp://10.0.x.x./vagrant_quanta_d51xxx.pxe... Permission denied (http://ipxe.org/xxxx) No More network devices No bootable device
It’s highly possible that the br1 is not up in vNode Host OS.
When you want to restart or start the vNode , please add “--provision” !!
$ vagrant.exe up quanta_d51 –provision
or
$vagrant reload –provision
Never ever use “Reset” in virtualbox VM like below. it will not execute the "provision" step in Vagarantfile.
By Former user (Deleted) , Former user (Deleted)