lxc-start-ephemeral keeps same MAC address, and so same IP address, as base instance
Bug #949956 reported by
Gary Poster
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
As smoser pointed out, lxc-start-ephemeral needs to do the same kinds of things that lxc-clone does, such as this:
# change hwaddrs
mv ${c} ${c}.old
(
while read line; do
if [ "${line:0:18}" = "lxc.network.
echo "lxc.network.
else
echo $line
fi
done
) < ${c}.old > ${c}
rm -f ${c}.old
# set the hostname
cat <<EOF > $rootfs/
$hostname
EOF
# set minimal hosts
cat <<EOF > $rootfs/etc/hosts
127.0.0.1 localhost $hostname
EOF
We have a version that does this, and will propose it.
Related branches
lp:~benji/ubuntu/precise/lxc/bug-949956
- Ubuntu branches: Pending requested
-
Diff: 32 lines (+17/-0)2 files modified.bzrignore (+2/-0)
debian/local/lxc-start-ephemeral (+15/-0)
To post a comment you must log in.
I've submitted an MP (https:/ /code.launchpad .net/~benji/ ubuntu/ precise/ lxc/bug- 949956/ +merge/ 96601) to fix this.
The hostname and /etc/hosts munging is already done in lxc-start-ephemeral (and arguably in a superior way), so I left that part alone.