running proxmox 5beta2 in vagrant (libvirt/kvm) using this packer build, https://github.com/rgl/proxmox-ve/tree/pve-5
when running any pvesh commands from the provision script, the gui seems to be disabled. the first time i look, the node is replaced by a red "node1", after logging out and back in, roots password is not accepted even if i change it from the shell. but, pvesh seems to work fine. its only the webui that gets messed up. if you run the vagrant file below, and uncomment that last line, you should see the error. i tried a few times with that last line commented out and uncommented. the behavior is consistent. but, after letting vagrant up complete, sshing in and running that command does not break the ui. i say "i" because it could be something weird about my environment. the vagrant host is fedora 25 with upstream vagrant and upstream libvirt plugin.
the last line in provision is the one that does it. id like to file a bug report, but id like to narrow this down first. could it be something in the packer file? any suggestions on debugging this?
when running any pvesh commands from the provision script, the gui seems to be disabled. the first time i look, the node is replaced by a red "node1", after logging out and back in, roots password is not accepted even if i change it from the shell. but, pvesh seems to work fine. its only the webui that gets messed up. if you run the vagrant file below, and uncomment that last line, you should see the error. i tried a few times with that last line commented out and uncommented. the behavior is consistent. but, after letting vagrant up complete, sshing in and running that command does not break the ui. i say "i" because it could be something weird about my environment. the vagrant host is fedora 25 with upstream vagrant and upstream libvirt plugin.
the last line in provision is the one that does it. id like to file a bug report, but id like to narrow this down first. could it be something in the packer file? any suggestions on debugging this?
Code:
net = "10.12.12."
Vagrant.configure('2') do |config|
config.vm.box = 'proxmox-ve'
config.vm.synced_folder './','/vagrant', type: 'rsync'
config.vm.provider :libvirt do |lv|
lv.memory = 4096
lv.cpus = 2
lv.cpu_mode = 'host-passthrough'
lv.nested = true
end
config.vm.define "node1" do |n1|
n1_ip = net + "21"
n1.vm.hostname = "node1"
n1.vm.provider :libvirt do |lv|
lv.storage :file, :size => '50G'
end
n1.vm.network "private_network", ip: n1_ip, auto_config: false
n1.vm.provision "shell", path: "provision.sh", args: n1_ip
end
end
Code:
#!/bin/bash
set -eux
ip=$1
fqdn=$(hostname --fqdn)
# configure apt for non-interactive mode.
export DEBIAN_FRONTEND=noninteractive
# fix /etc/hosts so ceph works
# removes the first instance of 127.0.0.1 with the name
# so ceph createmon finds the one with the "real" ip address
# as of this writing, its the first line
sed -i "/^127\.0\.0\.1.\+${fqdn}/d" /etc/hosts
# configure the network for NATting.
ifdown vmbr0
cat >/etc/network/interfaces <<EOF
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet manual
auto vmbr0
iface vmbr0 inet static
address $ip
netmask 255.255.255.0
bridge_ports eth1
bridge_stp off
bridge_fd 0
# enable IP forwarding. needed to NAT and DNAT.
post-up echo 1 >/proc/sys/net/ipv4/ip_forward
# NAT through eth0.
post-up iptables -t nat -A POSTROUTING -s '$ip/24' ! -d '$ip/24' -o eth0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '$ip/24' ! -d '$ip/24' -o eth0 -j MASQUERADE
EOF
sed -i -E "s,^[^ ]+( .*pve.*)\$,$ip\1," /etc/hosts
sed 's,\\,\\\\,g' >/etc/issue <<'EOF'
_ __ _ __ _____ ___ __ ___ _____ __ __ _____
| '_ \| '__/ _ \ \/ / '_ ` _ \ / _ \ \/ / \ \ / / _ \
| |_) | | | (_) > <| | | | | | (_) > < \ V / __/
| .__/|_| \___/_/\_\_| |_| |_|\___/_/\_\ \_/ \___|
| |
|_|
EOF
cat >>/etc/issue <<EOF
https://$ip:8006/
https://$fqdn:8006/
EOF
ifup vmbr0
# iptables-save # show current rules.
killall agetty | true # force them to re-display the issue file.
# set up more storage
mkfs.ext4 /dev/vdb
mkdir /vmspace
echo /dev/vdb /vmspace ext4 defaults 0 0 >> /etc/fstab
mount /vmspace
# pvesh create /storage -storage vmspace -type dir -content rootdir,images -path /vmspace