Vacuum the room as you would and give your dog a treat or praise so that the pet does not attack the vacuum cleaner. As the dogs believe in making their owners happy, and a reward or praise from their owner signifies joy, therefore, they will focus on not attacking the vacuum to make you happy and get a reward or praise.