scripts: Update the COS scripts

Adjust the path and make sure convert_image.sh & make_ova.sh works.

BUG=b/173643442
TEST=Manual Test
RELEASE_NOTE=None

Change-Id: I43af936c593529ba896d18ecbc0a910fe41d191b
Reviewed-on: https://cos-review.googlesource.com/c/third_party/platform/crosutils/+/10880
Tested-by: Roy Yang <royyang@google.com>
Reviewed-by: Robert Kolchmeyer <rkolchmeyer@google.com>
diff --git a/cos/convert_image.sh b/cos/convert_image.sh
index bae8e40..508b9b1 100755
--- a/cos/convert_image.sh
+++ b/cos/convert_image.sh
@@ -8,8 +8,9 @@
 #
 # This script converts a board's image(base, test, dev) to the specified format
 # like vmdk, vhd so that the image can be used by platform other than GCP.
-
+#
 SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
+SCRIPT_ROOT=${SCRIPT_ROOT%cos}
 . "${SCRIPT_ROOT}/build_library/build_common.sh" || exit 1
 
 # Script must be run inside the chroot.
diff --git a/cos/cos.json b/cos/cos.json
new file mode 100644
index 0000000..a22b87e
--- /dev/null
+++ b/cos/cos.json
@@ -0,0 +1,42 @@
+{
+    "DiskProvisioning": "thin",
+    "IPAllocationPolicy": "dhcpPolicy",
+    "IPProtocol": "IPv4",
+    "InjectOvfEnv": false,
+    "MarkAsTemplate": false,
+    "Name": null,
+    "NetworkMapping": [
+        {
+            "Name": "VM Network",
+            "Network": ""
+        }
+    ],
+    "PowerOn": false,
+    "PropertyMapping": [
+        {
+            "Key": "instance-id",
+            "Value": "id-ovf"
+        },
+        {
+            "Key": "hostname",
+            "Value": ""
+        },
+        {
+            "Key": "seedfrom",
+            "Value": ""
+        },
+        {
+            "Key": "public-keys",
+            "Value": ""
+        },
+        {
+            "Key": "user-data",
+            "Value": ""
+        },
+        {
+            "Key": "password",
+            "Value": ""
+        }
+    ],
+    "WaitForIP": false
+}
diff --git a/cos/make_ova.sh b/cos/make_ova.sh
index 8791597..543a890 100755
--- a/cos/make_ova.sh
+++ b/cos/make_ova.sh
@@ -3,7 +3,9 @@
 # Copyright 2021 The Chromium OS Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
-
+#
+# make_ova.sh -d [vmdk file] -o [ova file] -p[product-name] \
+#  -n[image-name] -t ${TEMPLATE_OVF}
 #
 # This scripts creates .ova file from given disk image and OVA template.
 #
@@ -12,16 +14,26 @@
 set -o errexit
 set -o nounset
 
-TEMPLATE_PATH=/usr/share/make-ova/template.ovf
+SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
+TEMPLATE_PATH=${SCRIPT_ROOT}/template.ovf
+WORKSPACE=${SCRIPT_ROOT%\/src\/scripts\/cos}
+BOARD=anthos-amd64-vsphere
+PRODUCT_NAME="Anthos OnPrem on COS"
+IMAGE_NAME="COS"
+IMAGE_TYPE="test"
+IMAGE_ROOT=${WORKSPACE}/src/build/images/${BOARD}/latest
+DISK_FILE=${IMAGE_ROOT}/chromiumos_${IMAGE_TYPE}_image.vmdk
+OUTPUT_FILE=${IMAGE_ROOT}/chromiumos_${IMAGE_TYPE}_image.ova
 
 usage() {
-  echo "Usage: $0 -d disk.vmdk \
+  echo "Usage: $0 -b board -d disk.vmdk \
     -p product-name -n image-name \
     -o output-file [-t template.ovf]"
 }
 
-while getopts ":d:p:n:t:o:h" arg; do
+while getopts ":b:d:p:n:t:o:h" arg; do
   case $arg in
+    b) BOARDD=$OPTARG ;;
     d) DISK_FILE=$OPTARG ;;
     p) PRODUCT_NAME=$OPTARG ;;
     n) IMAGE_NAME=$OPTARG ;;
@@ -38,6 +50,7 @@
   esac
 done
 
+: "${BOARD?Missing -d BOARD value}"
 : "${DISK_FILE?Missing -d DISK_FILE value}"
 : "${PRODUCT_NAME?Missing -p PRODUCT_NAME value}"
 : "${IMAGE_NAME?Missing -n IMAGE_NAME value}"
diff --git a/cos/run_vmtests.sh b/cos/run_vmtests.sh
index b968973..b37f85f 100755
--- a/cos/run_vmtests.sh
+++ b/cos/run_vmtests.sh
@@ -4,11 +4,12 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-# run_vmtests.sh --board=[board]
+# cos/run_vmtests.sh --board=[anthos-amd64-vsphere]
 #
 # This script builds and runs VMTests for a given board.
 
 SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
+SCRIPT_ROOT=${SCRIPT_ROOT%cos}
 . "${SCRIPT_ROOT}/build_library/build_common.sh" || exit 1
 
 # Script must be run inside the chroot.
@@ -16,7 +17,7 @@
 
 DEFINE_string board "${DEFAULT_BOARD}" \
   "The board to build an image for."
-DEFINE_string image_type "base" \
+DEFINE_string image_type "test" \
   "Image type to process, base, test or dev."
 DEFINE_string image_dir "" "Path to the folder to store netboot images."
 
@@ -40,7 +41,7 @@
 fi
 
 cros_run_vm_test --board ${BOARD} \
-  --image-path ${IMAGE_DIR}/chromiumos_${IMAGE_TYPE}_image.bin \
+  --image-path ${IMAGE_DIR}/chromiumos_${FLAGS_image_type}_image.bin \
   --private-key ${IMAGE_DIR}/id_rsa \
   --test_that-args=--model=ad_hoc_model \
   --copy-on-write \
diff --git a/cos/template.ovf b/cos/template.ovf
index cdc96df..f8b5220 100644
--- a/cos/template.ovf
+++ b/cos/template.ovf
@@ -26,7 +26,7 @@
           <Label>A Unique Instance ID for this instance</Label>
           <Description>Specifies the instance id.  This is required and used to determine if the machine should take "first boot" actions</Description>
       </Property>
-      <Property ovf:key="hostname" ovf:type="string" ovf:userConfigurable="true" ovf:value="ubuntuguest">
+      <Property ovf:key="hostname" ovf:type="string" ovf:userConfigurable="true" ovf:value="cosguest">
           <Description>Specifies the hostname for the appliance</Description>
       </Property>
       <Property ovf:key="seedfrom" ovf:type="string" ovf:userConfigurable="true">