Isso realmente funcionou para mim sem problemas usando a imagem do Centos 7. Eu criei a VM a partir do console e adicionei este pequeno script
#! /bin/bash
yum update
yum install -y httpd
cat <<EOF > /var/www/html/index.html
<html><body><h1>Hello World</h1>
<p>This page was created from a simple startup script!</p>
</body></html>
EOF
Após a criação da VM, consegui verificar se o Apache tinha sido instalado no console serial .
…
Feb 3 20:36:17 instance-3 startup-script: INFO startup-script: ---> Package httpd.x86_64 0:2.4.6-45.el7.centos will be installed
Feb 3 20:36:17 instance-3 startup-script: INFO startup-script: --> Processing Dependency: httpd-tools = 2.4.6-45.el7.centos for package: httpd-2.4.6-45.el7.centos.x86_64
Feb 3 20:36:17 instance-3 startup-script: INFO startup-script: --> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-45.el7.centos.x86_64
….
Feb 3 20:36:20 instance-3 startup-script: INFO startup-script: Installed:
Feb 3 20:36:20 instance-3 startup-script: INFO startup-script: httpd.x86_64 0:2.4.6-45.el7.centos
Feb 3 20:36:20 instance-3 startup-script: INFO startup-script: Dependency Installed:
Feb 3 20:36:20 instance-3 startup-script: INFO startup-script: apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7
Feb 3 20:36:20 instance-3 startup-script: INFO startup-script: httpd-tools.x86_64 0:2.4.6-45.el7.centos mailcap.noarch 0:2.1.41-2.el7
Feb 3 20:36:20 instance-3 startup-script: INFO startup-script: Complete!
O script instalou o Apache, mas o serviço na VM não foi iniciado. Eu só tive que SSH na VM para iniciar o serviço.