diff --git a/prepare.sh b/prepare.sh index 42e2525..8611366 100755 --- a/prepare.sh +++ b/prepare.sh @@ -30,6 +30,9 @@ start_container () { restore_snapshot "$CONTAINER_IMAGE" "$CURRENT_VERSION" "$SNAPSHOT_NAME" + # Unset the mac address to ensure the copy will get a new one and will be able to get new IP + lxc config unset "$CONTAINER_IMAGE" volatile.eth0.hwaddr 2> /dev/null + lxc start $CONTAINER_IMAGE wait_container $CONTAINER_IMAGE diff --git a/utils.sh b/utils.sh index 298e26e..0d7f55a 100755 --- a/utils.sh +++ b/utils.sh @@ -98,9 +98,6 @@ create_snapshot() local ynh_version=$2 local snapshot=$3 - # Unset the mac address to ensure the copy will get a new one and will be able to get new IP - lxc config unset "$image_to_rebuild" volatile.eth0.hwaddr 2> /dev/null - # Create snapshot lxc snapshot "$instance_to_publish" "$ynh_version-$snapshot" --reuse }