The Advice Spot
A visitor from Buena Park got here by googling "discouraging dog attacks on vacuum". I aoplogise that this site may have been found wanting for the lady or gentleman, and I as a good host, feel compelled to apologise for my neglect in tackling this subject when Google appears to lead here. I am, therefore, putting the matter right and will, in future, respond to Google searches.
This is how you stop a dog from attacking a vacuum cleaner when you're using it (they rarely attack it when you aren't):
Stick the little bastard outside while you do it. Or if that's not an option, stick them in the kitchen, or bathroom for the duration. Basically, don't let the dog be where you're hoovering.