From 4a0e9cfb2f3312387f87f1c1774e62296d657268 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 30 Aug 2017 03:07:41 -0700 Subject: [PATCH 1/3] oem/oracle: Launch a small VM instance by default This is faster and cheaper than launching a bare-metal instance, which is no longer necessary now that networkd works in OCI VMs. --- oem/oracle/launch-instance | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oem/oracle/launch-instance b/oem/oracle/launch-instance index cea9c542b3..9ca2c03dde 100755 --- a/oem/oracle/launch-instance +++ b/oem/oracle/launch-instance @@ -10,7 +10,7 @@ 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= baseurl="http://alpha.release.core-os.net/amd64-usr/current" From 51c5345c0d25ea926f24d204fb67128d09dd9e51 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 30 Aug 2017 03:10:15 -0700 Subject: [PATCH 2/3] build_library: Add Oracle OCI OEM and format --- build_library/vm_image_util.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index f1d3a50dd2..ae169fb026 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -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 From 95b2c96ce219d16ed36ef282d7da79eea42b53c1 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 30 Aug 2017 16:20:55 -0700 Subject: [PATCH 3/3] oem/oracle: Set SSH keys when launching instance --- oem/oracle/launch-instance | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/oem/oracle/launch-instance b/oem/oracle/launch-instance index 9ca2c03dde..804ffe0786 100755 --- a/oem/oracle/launch-instance +++ b/oem/oracle/launch-instance @@ -13,10 +13,15 @@ name= 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}" \