Merge pull request #734 from bgilbert/oracle

Add Oracle OCI image format
This commit is contained in:
Benjamin Gilbert 2017-08-30 18:57:11 -07:00 committed by GitHub
commit b48afe581e
2 changed files with 18 additions and 2 deletions

View File

@ -12,6 +12,7 @@ VALID_IMG_TYPES=(
iso
openstack
openstack_mini
oracle_oci
qemu
qemu_uefi
qemu_uefi_secure
@ -52,6 +53,7 @@ VALID_OEM_PACKAGES=(
exoscale
gce
hyperv
oracle-oci
rackspace
rackspace-onmetal
vagrant
@ -241,6 +243,10 @@ IMG_gce_CONF_FORMAT=gce
IMG_gce_OEM_PACKAGE=oem-gce
IMG_gce_OEM_ACI=gce
## Oracle OCI
IMG_oracle_oci_DISK_FORMAT=qcow2
IMG_oracle_oci_OEM_PACKAGE=oem-oracle-oci
## rackspace
IMG_rackspace_OEM_PACKAGE=oem-rackspace
IMG_rackspace_vhd_DISK_FORMAT=vhd

View File

@ -10,13 +10,18 @@ availability_domain=$(get_availability_domain "${compartment}")
image_id=$(get_an_image_id "${compartment}")
subnet_id=$(get_subnet_id "${compartment}" "${availability_domain}")
name=
shape="BM.Standard1.36"
shape="VM.Standard1.1"
ipxe=0
ignition=
keyfile="$HOME/.ssh/id_rsa.pub"
baseurl="http://alpha.release.core-os.net/amd64-usr/current"
bucket_base="users.developer.core-os.net/$USER/bmcs"
kargs=
if [[ ! -f "$keyfile" ]]; then
keyfile=""
fi
# Parse args
usage="Usage: $0 [args] -n name
Options:
@ -26,6 +31,7 @@ Options:
-s SHAPE Instance shape (default: ${shape})
-S SUBNET-ID Subnet ID to use (default: ${subnet_id})
-i IGNITION Path to Ignition config
-A SSH-KEYS Path to SSH keys (default: ${keyfile})
-p Boot with iPXE
-I IMAGE-ID Image ID to use; only relevant for non-iPXE (default: ${image_id})
-b BASEURL URL to the image mirror; only relevant for iPXE (default: ${baseurl})
@ -33,7 +39,7 @@ Options:
-k ARGS Additional kernel command line arguments for iPXE script
-h This ;-)
"
while getopts "c:a:n:s:S:i:pI:b:B:k:h" OPTION
while getopts "c:a:n:s:S:i:A:pI:b:B:k:h" OPTION
do
case "${OPTION}" in
c) compartment="${OPTARG}" ;;
@ -42,6 +48,7 @@ do
s) shape="${OPTARG}" ;;
S) subnet_id="${OPTARG}" ;;
i) ignition="${OPTARG}" ;;
A) keyfile="${OPTARG}" ;;
p) ipxe=1 ;;
I) image_id="${OPTARG}" ;;
b) baseurl="${OPTARG}" ;;
@ -97,6 +104,9 @@ fi
if [[ -n "${ignition}" ]]; then
launch_args+=("--user-data-file" "${ignition}")
fi
if [[ -n "${keyfile}" ]]; then
launch_args+=("--ssh-authorized-keys-file" "${keyfile}")
fi
bmcs compute instance launch \
--availability-domain "${availability_domain}" \
--compartment-id "${compartment}" \