go-via

command module
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2022 License: GPL-3.0 Imports: 38 Imported by: 0

README

Custom deployment tool for VMware ESXi Hypervisor

Credits

Massive credits go to one of my best friends, and mentor Jonathan "stamp" G for all the help, coaching and lessons during this project. Without your support this project would never have been a reality.

VMware #clarity-ui channel for being super helpful with newbie questions about clarity!

What is go-via?

go-via is a single binary, that when executed performs the tasks of dhcpd, tftpd, httpd, and ks.cfg generator, with a angular front-end, and http-rest backend written in go, and sqlite for persisting.

Why a new version of VMware Imaging Appliance?

The old version of VIA had some things it didn't support which made it hard to run in enterprise environments. go-via brings added support for the following.

  1. IP-Helper , you can have the go-via binary running on any network you want and use RFC 3046 IP-Helper to relay DHCP requests to the server.
  2. UEFI , go-via does not support BIOS, but does support UEFI and secure-boot. BIOS may be added in the future.
  3. Virtual environments, it does not block nested esxi host deployment.
  4. HTTP-REST, everything you can do in the UI, you can do via automation also.
  5. Options to perform all prerequisites for VMware Cloud Foundation 4.x

Supported Architectures

UEFI x86_64 INTEL/AMD architecture UEFI arm_64 ARM architecture (including Project Monetery/SmartNICs)

Installation / Running

Option 1: docker container

To run this container on a ubuntu 21.04 server, do the following:

install docker-ce (https://docs.docker.com/engine/install/ubuntu/)

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

install latest docker-compose,

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose

Option A: create the following docker-compose.yaml file to not specify a config file (dhcpd will serve on all interfaces)

version: "3.9"
services:
  go-via:
    image: maxiepax/go-via:latest
    network_mode: host
    volumes:
      - ./tftp:/go/tftp
      - ./database:/go/database
      - ./config:/go/config
      - ./cert:/go/cert
      - ./secret:/go/secret

Option B: or create this docker-compose.yaml to specify a config file, and place config in ./config/config.json

version: "3.9"
services:
  go-via:
    image: maxiepax/go-via:latest
    network_mode: host
    volumes:
      - ./tftp:/go/tftp
      - ./database:/go/database
      - ./config:/go/config
      - ./cert:/go/cert
      - ./secret:/go/secret
    command: -file /go/config/config.json

Example config file

{
    "network": {
        "interfaces": ["ens224", "ens192"]
    },
    "port": 443
}

now start the container

sudo docker-compose up -d

Option 2: Download the latest release, and run ./go-via -file config.json

Most linux distributions should work, this has been tested on Ubuntu 20.20.

#wget the release you want to download, e.g go-via_.<release>_linux_amd64.tar.gz
wget https://github.com/maxiepax/go-via/releases/download/<release>/go-via_.<release>_linux_amd64.tar.gz


#untar/extract it
tar -zxvf go-via_.<release>_linux_amd64.tar.gz

This will extract the files README.MD (this document) and go-via binary.

Optional: example config files.

Multi interface, and custom port.

{
    "network": {
        "interfaces": ["ens224", "ens192"]
    },
    "port": 443
}

Single interface, default port 8443

{
    "network": {
        "interfaces": ["ens224"]
    }
}

Now start the binary as super user, (optionally: pointing to the config file.)

#start teh application with default settings
sudo ./go-via

#start the application with normal debug level
sudo ./go-via -file config.json

#start the application with verbose debug level
sudo ./go-via -file config.json -debug

You should be greeted with the following output.

INFO[0000] Startup                                       commit=none date=unknown version=dev
WARN[0000] no interfaces have been configured, trying to find interfaces to serve to, will serve on all. 
INFO[0000] Existing database sqlite-database.db found   
INFO[0000] Starting dhcp server                          int=ens224 ip=172.16.100.1 mac="00:0c:29:91:cf:eb"
INFO[0000] Starting dhcp server                          int=ens192 ip=192.168.1.173 mac="00:0c:29:91:cf:e1"
INFO[0000] Starting dhcp server                          int=docker0 ip=172.17.0.1 mac="02:42:09:9f:04:4f"
INFO[0000] cert                                          server.crt="server.crt found"
INFO[0000] Webserver                                     port=":8443"

You can now browse to the web-frontend on the ip of the interface you specified, and the port 8080.

The default username/password is admin/VMware1!

Option 3: Download source and compile with go 1.16 and Angular 11

with Ubuntu 20.20 installed, do the following: install golang 1.16.x compiler

sudo snap install go --classic

install npm

sudo apt-get install npm

install angular-cli

sudo npm install npm@latest -g
sudo npm install -g @angular/cli

start two terminals:

terminal 1:

mkdir ~/go
cd ~/go
git clone https://github.com/maxiepax/go-via.git
cd go-via
go run *.go

terminal 2:

cd ~/go-via/web
npm install
# to only allow localhost access to gui:
ng serve
# to allow anyone access to gui:
ng serve --host 0.0.0.0

Troubleshooting

To troubleshoot, enable debugging.

Option 1: Docker Container. Append -debug to command.

command: -debug
or
command: -file /go/config/config.json -debug

Option 2: Source or Binary. Append -debug to command

./go-via -debug

Known issues

Please note that go-via is still under heavy development, and there may be bugs. Following is the list of known issues.

currently tracking no known issues! :D

Todo

  • Currently no requests have been made for features. Please submit any ideas you have.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL