How to get OS::Heat::CloudConfig to copy files into my virtual machine?

asked 2016-05-19 10:16:07 -0500

rmelton gravatar image

I am working with OpenStack Kilo installed on Ubuntu14.04 which seems to work correctly.

I have written several Heat Orchestration templates. I am trying to use OS::Heat::CloudConfig resource type to configure a virtual machine as it is being started by OS::Nova::Server. I need to know what to put in the heat .yaml file in the OS::Heat::CloudConfig section to cause cloud-init to copy external binary files into the VM during cloud-init.

I know about write_files, but this seems to only create files from inline text in the .yaml file. I need to get CloudConfig/cloud-init to copy external binary files into the virtual machine. How can I get a CloudConfig property to copy binary files from external host into the virtual machine?

here's a part of my Heat template:
type: "OS::Heat::CloudConfig"
    package_update: true
    package_upgrade: true
    - stress
    - git
    - tree
    - netperf
    - stress-ng
    - htop
    - build-essential
    - gedit
    - libxml2-utils
    - python-pip
    - wget
    - ntp
    - default
    - name: confduser
      groups: users,sudo
      lock-passwd: false
      passwd: 's0hzqP7jYt94A' 
      shell: /bin/bash
      sudo: "ALL=(ALL) NOPASSWD:ALL"
    ssh_pwauth: true
      -  owner: "ubuntu"
         path: "/etc/hosts"
         permissions: "0644"
         content: |
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-05-19 13:06:42 -0500

Matt G gravatar image

You can use runcmd to ftp or wget a resource, eg:

 - [ wget, "http://my.resource-server.local/resources/myresource.tgz", -O, /root/myresource.tgz ]
edit flag offensive delete link more


thanks for the answer. i had thought about ftp/wget type solutions. i was trying not to have to setup an external server but maybe there's not way to get around it. anyway, thanks.

rmelton gravatar imagermelton ( 2016-05-19 14:34:38 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-05-19 10:14:26 -0500

Seen: 1,385 times

Last updated: May 19 '16