2 # Create OpenStack heat template file
4 cat <<EOF > ${heat_template}
5 heat_template_version: 2013-05-23
7 description: Simple template to deploy a single compute instance
13 description: Name of the instance to be used
17 description: Name of key-pair to be used for compute instance
21 description: Image to be used for compute instance
25 description: Type of instance (flavor) to be used
29 description: public NetId
33 description: public subnet NetId
39 default: onap_offline_build_volume
46 VMwithvolume_0_private_port:
47 type: OS::Neutron::Port
49 network: { get_param: public_net_id }
50 fixed_ips: [{"subnet": { get_param: public_net_subnet }}]
52 - { get_param: onap_sg }
56 type: OS::Nova::Server
58 name: { get_param: instance_name }
59 availability_zone: nova
60 key_name: { get_param: key }
61 image: { get_param: image_name }
62 flavor: { get_param: flavor_name }
64 - port: { get_resource: VMwithvolume_0_private_port }
75 while [ ! -e /dev/vdb ]; do echo Waiting for volume /dev/sdb to attach; sleep 1; done
79 echo "Partitions not formated, format it as ext4"
80 # yes /dev/disk/by-id/, partprobe and hdparm show it is there, but no it is is not ready
83 file -sL /dev/disk/by-id/*
87 echo "/dev/vdb /tmp ext4 defaults,nofail 0 0" >> /etc/fstab
92 type: OS::Cinder::Volume
94 name: { get_param: volume_name }
95 size: { get_param: volume_size }
98 type: OS::Cinder::VolumeAttachment
100 volume_id: { get_resource: cinder_volume }
101 instance_uuid: { get_resource: VMwithvolume_0 }