<commit_before>#!/usr/bin/env bash
#
# Copyright (c) 2009-2012 VMware, Inc.

set -e

base_dir=$(readlink -nf $(dirname $0)/../..)
source $base_dir/lib/prelude_apply.bash

ovf=$work/ovf

mkdir -p $ovf

disk_size=$(($(stat --printf="%s" $work/${stemcell_image_name}) / (1024*1024)))

# 512 bytes per sector
disk_sectors=$(($disk_size * 2048))

# 255 * 63 = 16065 sectors per head
disk_cylinders=$(($disk_sectors / 16065))

# Output disk description
cat > $ovf/root.vmdk <<EOS
version=1
CID=ffffffff
parentCID=ffffffff
createType="vmfs"

# Extent description
RW $disk_sectors FLAT "$work/${stemcell_image_name}" 0
ddb.toolsVersion = "0"
ddb.adapterType = "lsilogic"
ddb.geometry.biosSectors = "63"
ddb.geometry.biosHeads = "255"
ddb.geometry.biosCylinders = "$disk_cylinders"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "255"
ddb.geometry.cylinders = "$disk_cylinders"
ddb.virtualHWVersion = "4"
EOS

vm_mem=512
vm_cpus=1
vm_hostname=ubuntu
vm_arch=amd64
vm_guestos=ubuntu-64

cat > $ovf/$vm_hostname.vmx <<EOS
config.version = "8"
virtualHW.version = 7
floppy0.present = "true"
nvram = "nvram"
deploymentPlatform = "windows"
virtualHW.productCompatibility = "hosted"
tools.upgrade.policy = "useGlobal"
powerType.powerOff = "default"
powerType.powerOn = "default"
powerType.suspend = "default"
powerType.reset = "default"

displayName = "$vm_hostname $vm_arch"

numvcpus = "$vm_cpus"
scsi0.present = "true"
scsi0.sharedBus = "none"
scsi0.virtualDev = "lsilogic"
memsize = "$vm_mem"

scsi0:0.present = "true"
scsi0:0.fileName = "root.vmdk"
scsi0:0.deviceType = "scsi-hardDisk"
<commit_msg>Bump vSphere virtualization version to 8<commit_after>#!/usr/bin/env bash
#
# Copyright (c) 2009-2012 VMware, Inc.

set -e

base_dir=$(readlink -nf $(dirname $0)/../..)
source $base_dir/lib/prelude_apply.bash

ovf=$work/ovf

mkdir -p $ovf

disk_size=$(($(stat --printf="%s" $work/${stemcell_image_name}) / (1024*1024)))

# 512 bytes per sector
disk_sectors=$(($disk_size * 2048))

# 255 * 63 = 16065 sectors per head
disk_cylinders=$(($disk_sectors / 16065))

# Output disk description
cat > $ovf/root.vmdk <<EOS
version=1
CID=ffffffff
parentCID=ffffffff
createType="vmfs"

# Extent description
RW $disk_sectors FLAT "$work/${stemcell_image_name}" 0
ddb.toolsVersion = "0"
ddb.adapterType = "lsilogic"
ddb.geometry.biosSectors = "63"
ddb.geometry.biosHeads = "255"
ddb.geometry.biosCylinders = "$disk_cylinders"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "255"
ddb.geometry.cylinders = "$disk_cylinders"
ddb.virtualHWVersion = "4"
EOS

vm_mem=512
vm_cpus=1
vm_hostname=ubuntu
vm_arch=amd64
vm_guestos=ubuntu-64

cat > $ovf/$vm_hostname.vmx <<EOS
config.version = "8"
virtualHW.version = 8
floppy0.present = "true"
nvram = "nvram"
deploymentPlatform = "windows"
virtualHW.productCompatibility = "hosted"
tools.upgrade.policy = "useGlobal"
powerType.powerOff = "default"
powerType.powerOn = "default"
powerType.suspend = "default"
powerType.reset = "default"

displayName = "$vm_hostname $vm_arch"

numvcpus = "$vm_cpus"
scsi0.present = "true"
scsi0.sharedBus = "none"
scsi0.virtualDev = "lsilogic"
memsize = "$vm_mem"

scsi0:0.present = "true"
scsi0:0.fileName = "root.vmdk"
scsi0:0.deviceType = "scsi-hardDisk"

{'fraction_non_alphanumeric': 0.15341440598690365, 'fraction_numerical': 0.04583723105706267, 'mean_word_length': 5.600823045267489, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7479033', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1299, 'n_words': 249}