Skip to content

Confused about userdata #79

@myoung34

Description

@myoung34

I'm scratching my head with an issue, perhaps you can save me that headache.

I maintain the vagrant-ovirt3 plugin, and I'm looking to actually utilize userdata. The documentation I took over from the upstream project is lacking.

My vagrantfile contains:

ovirt.user_data =<<-EOF
  runcmd:
    - yum install -y ntpdate samba-winbind krb5-workstation samba-winbind-krb5-locator
EOF

that gets set in lib/vagrant-ovirt3/action/create_vm.rb as:

user_data = config.user_data ?
  Base64::encode64(config.user_data) :
    nil

and evenually

           attr = {
               :name     => name,
               :cores    => cpus,
               :memory   => memory_size*1024,
               :cluster  => cluster.id,
               :template => template.id,
               :display  => {:type => console },
               :user_data => user_data,
           }

           begin
             server = env[:ovirt_compute].servers.create(attr)
...snip...

My locales gets no error message from this, so pulling it out of the begin/rescue i get a pretty ugly stacktrace:

Marc-win8:example_box $ vagrant up --provider=ovirt3
Bringing machine 'default' up with 'ovirt3' provider...
==> default: Creating VM with the following settings...
==> default:  -- Name:          example_box_1430229427.903915
==> default:  -- Cpus:          1
==> default:  -- Memory:        512M
==> default:  -- Template:      vagrant-centos65
==> default:  -- Version:       0
==> default:  -- Datacenter:    local_dc
==> default:  -- Cluster:       local_cluster
==> default:  -- Console:       spice
==> default:  -- User data:
==> default:     runcmd:
==> default:      - yum install -y ntpdate samba-winbind krb5-workstation samba-winbind-krb5-locator
==> default: An error occured. Recovering..
==> default: VM is not created. Please run `vagrant up` first.
C:/Users/myoung/.vagrant.d/gems/gems/rbovirt-0.0.35/lib/rbovirt.rb:197:in `handle_fault': OVIRT::OvirtException
        from C:/Users/myoung/.vagrant.d/gems/gems/rbovirt-0.0.35/lib/rbovirt.rb:124:in `rescue in http_post'
        from C:/Users/myoung/.vagrant.d/gems/gems/rbovirt-0.0.35/lib/rbovirt.rb:119:in `http_post'
        from C:/Users/myoung/.vagrant.d/gems/gems/rbovirt-0.0.35/lib/client/vm_api.rb:34:in `create_vm'
        from C:/Users/myoung/.vagrant.d/gems/gems/fog-1.29.0/lib/fog/ovirt/requests/compute/create_vm.rb:6:in `create_vm'
        from C:/Users/myoung/.vagrant.d/gems/gems/fog-1.29.0/lib/fog/ovirt/models/compute/server.rb:157:in `save'
        from C:/Users/myoung/.vagrant.d/gems/gems/fog-core-1.30.0/lib/fog/core/collection.rb:51:in `create'
        from C:/Users/myoung/.vagrant.d/gems/gems/vagrant-ovirt3-1.4.0/lib/vagrant-ovirt3/action/create_vm.rb:89:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
        from C:/Users/myoung/.vagrant.d/gems/gems/vagrant-ovirt3-1.4.0/lib/vagrant-ovirt3/action/set_name_of_domain.rb:24:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builder.rb:116:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/call.rb:53:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
        from C:/Users/myoung/.vagrant.d/gems/gems/vagrant-ovirt3-1.4.0/lib/vagrant-ovirt3/action/connect_ovirt.rb:25:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builder.rb:116:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `block in run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19:in `busy'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:214:in `action_raw'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:191:in `block in action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:516:in `lock'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:178:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:178:in `action'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

I'm really drawing a blank as to what rbovirt expects for its user_data.
Cloud-init is all YAML, If i use the oVirt UI and paste in the YAML, things are good.
Is my expectation wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions