Let the possibility to disable instance metadata collection

Fix #975
Merge branch 'master' into v4.x