Obstruction of justice is a crime in Virginia. The most commonly charged version of Obstruction of justice requires the prosecutor to prove
that someone knowingly attempted to impede a law enforcement officer
By threats or force
In the lawful performance of his duties.
Some officers will charge someone with obstruction just because they aren't fully cooperative. Maybe they made the officer's job a little more difficult. That is not obstruction and the charge should get thrown out in court. The Virginia Court of Appeals has said that just making a police officer's job harder does not constitute obstruction.
The most common form of obstruction of justice is punishable as a class 1 misdemeanor. A class 1 misdemeanor carries up to 12 months in jail and a $2,500 fine. If you impede a law enforcement officer's lawful duty relating to a violent felony, then it can be charged as a class 5 felony. A class 5 felony is punishable by up to ten years in prison.
If an officer is making an unlawful arrest, the person the officer is unlawfully arresting or a relative can resist the arrest with reasonable force. It's important to remember that a illegal arrest can be resisted only with reasonable force. If you use too much force, then you can be convicted.
It's almost never a good idea to resist an arrest, even if you believe the arrest is unlawful. It's a bad idea to resist because you have no idea what information the officer is relying on in order to arrest you. The officer might tell you some of the information, but there's a good chance he won't give you all the information.
Also, resisting the unlawful arrest will not change the arresting officer's mind by resisting and you will potentially be charged with Assaulting a Law Enforcement Officer, which is a felony. You might eventually beat the charges in court, but you'll be forced to go through the stress and expense of a trial. It's generally better to simply allow the officer to illegally arrest you and then sue the officer and police department after the fact.
A criminal defense attorney will be able to advise you about your case. An attorney can tell you whether you should fight the charge or try to work out an agreement with the prosecutor. Often, obstruction of justice charges come along with other charges which means that a plea agreement can be negotiated that results in one of the charges being dismissed.