Ask Your Question
0

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:
myconfig:
type: "OS::Heat::CloudConfig"
properties:
  cloud_config:
    package_update: true
    package_upgrade: true
    packages:
    - stress
    - git
    - tree
    - netperf
    - stress-ng
    - htop
    - build-essential
    - gedit
    - libxml2-utils
    - python-pip
    - wget
    - ntp
    users:
    - default
    - name: confduser
      groups: users,sudo
      lock-passwd: false
      passwd: 's0hzqP7jYt94A' 
      shell: /bin/bash
      sudo: "ALL=(ALL) NOPASSWD:ALL"
    ssh_pwauth: true
    write_files:
      -  owner: "ubuntu"
         path: "/etc/hosts"
         permissions: "0644"
         content: |
           127.0.0.1 confd-vm
           127.0.0.1 localhost
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

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

Matt G gravatar image

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

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

Comments

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 1,127 times

Last updated: May 19 '16