windows heat template user_data can not work [closed]
hi
I am new to CloudbaseInit. I have setup a image with CloudbaseInit,and can build the machine with new password and expand hdd size all ok. But I want to use heat stack-create with a heat template file to deploy vm. here is the template ;
********************************
heat_template_version: 2013-05-23
description: dtb test hottest,for test add parameters.
parameters:
flavor:
type: string
label: paasflavor
description: paasflavor flavor to be used
default: c1m2h90
availability_zone:
type: string
description: The Availability Zone to launch the instance.
default: nova
name:
type: string
description: name of host.
resources:
server1_port1:
type: OS::Neutron::Port
properties:
network_id: 70c1faf0-51f6-4cb9-b324-7bc2cc6fab5b
server1:
type: OS::Nova::Server
properties:
name: { get_param: name }
image: template_win2008
flavor: { get_param: flavor }
availability_zone: { get_param: availability_zone }
networks:
- port: { get_resource: server1_port1 }
user_data:
echo 11 > \"c:\\yp\\333"\n,
outputs:
server1_ip:
description: Private IP address of server1
value: { get_attr: [ server1, first_address ] }
Machine builds ok. When I login into it, and go to c:\yp, I find nothing. I think user_data is wrong, and command not work. I have tried several other ways for writing user_data part, but all failed. I never build windows machine with heat template.
First, I think you need a pipe sign (vertical bar) after user_data to indicate line continuation, or put the echo on the same line. Then, see http://cloudbase-init.readthedocs.io/... for how to submit batch or powershell commands.
See also http://blog.oddbit.com/2014/11/15/cre.... You should have cloudinit log files on your instance.
thank you ,Bernd Bausch
problem has been done
user_data: |
rem cmd
...
that is ok
thank you everyone!