OVA Importer
Import a local or remote OVA
Usage
Build
Build the binary by running make build
Run
ovaimporter
return a response to stdout, and a file (defaults to ./response.json
) in json format.
ovaimporter
--ova https://storage.googleapis.com/capv-images/release/v1.17.3/ubuntu-1804-kube-v1.17.3.ova \
--network VM_Net \
--datacenter Datacenter-01 \
--datastore Datastore-01 \
--url 10.96.160.151 \
--user administrator@vsphere.local \
--password 'secret'
# Environment variables can be used in place of the CLI flags
OVAIMPORTER_URL=vcenter.example.org \
OVAIMPORTER_USER=myuser \
OVAIMPORTER_PASSWORD=secret \
OVAIMPORTER_OVA=https://storage.googleapis.com/capv-images/release/v1.17.3/ubuntu-1804-kube-v1.17.3.ova \
OVAIMPORTER_DATACENTER=dc1 \
OVAIMPORTER_DATASTORE=ds1 \
OVAIMPORTER_NETWORK=VM_Net \
ovaimporter
Response Object
For more details on the data types, the go importerResponse
struct can be found here: cmd/response.go
{
"alreadyExists": false,
"errorMsg": "",
"level": "",
"msg": "",
"name": "",
"responseFile": "",
"success": true,
"time": ""
}
Container Image
A container image is available at docker pull ghcr.io/jacobweinstock/ovaimporter:latest
USAGE
Build the container image locally with make build
# using cli flags
docker run -it --rm -v ${PWD}/response.json:/response.json ghcr.io/jacobweinstock/ovaimporter \
--url 10.96.160.151 \
--user admin \
--password 'secret' \
--ova https://storage.googleapis.com/capv-images/release/v1.17.3/ubuntu-1804-kube-v1.17.3.ova \
--datacenter DC01 \
--datastore DS01 \
--network VM_Net
# using env vars
docker run -it --rm \
-e OVAIMPORTER_URL=10.96.160.151 \
-e OVAIMPORTER_USER=admin \
-e OVAIMPORTER_PASSWORD='secret' \
-e OVAIMPORTER_OVA=https://storage.googleapis.com/capv-images/release/v1.17.3/ubuntu-1804-kube-v1.17.3.ova \
-e OVAIMPORTER_DATACENTER=Datacenter-01 \
-e OVAIMPORTER_DATASTORE=Datastore-01 \
-e OVAIMPORTER_NETWORK=VM_Net \
-v ${PWD}/response.json:/response.json \
ghcr.io/jacobweinstock/ovaimporter