Unable to create coreos box from another coreos box

22 views
Skip to first unread message

Belgana Ahmed

unread,
Mar 14, 2018, 12:41:42 PM3/14/18
to Vagrant
 Hi,

I want to use a coreos box that has all the containers I need to bootstrap k8s. I use vanilla coreos box to create my box.

The Vagrantfile I use to create my box is:

```
# -*- mode: ruby -*-
# # vi: set ft=ruby :

update_channel = "stable"

num_etcds = 1

instance_etcd_prefix = "etcd"

Vagrant.configure("2") do |config|
  config.ssh.insert_key = false
  config.vm.box = "coreos-%s" % update_channel
  config.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json" % update_channel

  (1..num_etcds).each do |i|
    vm_name = "%s-%02d" % [instance_etcd_prefix, i]
    config.vm.define vm_name do |host|
      host.vm.hostname = vm_name
    end
  end

    config.vm.post_up_message = "Vagrant has finished"
end
```

After that I just package the box to a new box. I use the new box to create a Vagrantfile, when I run Vagrant up I have the following error:

```
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop etcd
ifconfig 172.17.8.101 netmask 255.255.255.0
mv /tmp/etcd-cluster.service /media/state/units/
systemctl restart local-enable.service

# Restart default etcd
systemctl start etcd


Stdout from the command:



Stderr from the command:

Failed to stop etcd.service: Unit etcd.service not loaded.
SIOCSIFNETMASK: No such device
mv: cannot move '/tmp/etcd-cluster.service' to '/media/state/units/': No such file or directory
Failed to restart local-enable.service: Unit local-enable.service not found.
Failed to start etcd.service: Unit etcd.service not found.
```

Do you guys have any idea?

Alvaro Miranda Aguilera

unread,
Mar 15, 2018, 4:07:03 AM3/15/18
to vagra...@googlegroups.com
hello

yes

you have 2 options

1. the good one, you create your own base box, you can start with an existing box if needed check packer virtualbox-ovf and packer virtalbox-iso

2. not the ideal one, may work but YMMV, add config.ssh.insert_key = false

then destroy, up, package and test

on the intermediate box before packaging you should ensure the box you are going to package will work on the new vagrant environment, as things like macaddress will change.

vagrant up by default will create a new ssh key, that is not included when you run vagrant package


Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/adfd04d9-8310-4917-a211-5e3d1aa2016f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages