cat << EOF > /tmp/metadata
#!/bin/sh
if curl http://169.254.169.254/openstack
then
echo "XXX metadata OK"
else
echo "XXX metadata ERROR"
fi
EOF
openstack server delete vm0 2>/dev/null
openstack server create \
--flavor cirros256 \
--image cirros-0.4.0-x86_64-disk \
--nic net-id=private,v4-fixed-ip=10.0.0.41 \
--user-data /tmp/metadata \
--wait \
vm0 \
>/dev/null
openstack server show vm0 -f value -c addresses
sleep 4
openstack console log show vm0 | grep "XXX metadata"
-- end of script --
10.0.0.41 is an arbitrary fixed-ip I selected from the range of the private network. The first run finds "XXX metadata OK". Starting rom the second run (that is re-using the same IP) the following errors can be seen instead in the console log:
checking http://169.254.169.254/2009-04-04/instance-id
failed 1/20: up 3.26. request failed
failed 2/20: up 5.32. request failed
failed 3/20: up 7.45. request failed
failed 4/20: up 9.52. request failed
...
I managed to reproduce the error in my environment (on the master branch).
The config needed in devstack:
/etc/neutron/ metadata_ agent.ini cache.memory
[cache]
enabled = True
backend = dogpile.
I simplified the script a bit:
#!/bin/bash
cat << EOF > /tmp/metadata 169.254. 169.254/ openstack
#!/bin/sh
if curl http://
then
echo "XXX metadata OK"
else
echo "XXX metadata ERROR"
fi
EOF
openstack server delete vm0 2>/dev/null 0.4.0-x86_ 64-disk \ private, v4-fixed- ip=10.0. 0.41 \
openstack server create \
--flavor cirros256 \
--image cirros-
--nic net-id=
--user-data /tmp/metadata \
--wait \
vm0 \
>/dev/null
openstack server show vm0 -f value -c addresses
sleep 4
openstack console log show vm0 | grep "XXX metadata"
-- end of script --
10.0.0.41 is an arbitrary fixed-ip I selected from the range of the private network. The first run finds "XXX metadata OK". Starting rom the second run (that is re-using the same IP) the following errors can be seen instead in the console log:
checking http:// 169.254. 169.254/ 2009-04- 04/instance- id
failed 1/20: up 3.26. request failed
failed 2/20: up 5.32. request failed
failed 3/20: up 7.45. request failed
failed 4/20: up 9.52. request failed
...