A strategic surprise to Joseph Stalin and the Soviet Union, Operation Barbarossa was the German code name for its invasion of Russia on 22 June 1941, at 04:15 local time. Stalin had believed the Molotov-Ribbentrop Pact promising nonaggression from the Germans. The area of operations is called the Russian Front, or, from a German standpoint, the Eastern Front. Russians also call it the Great Patriotic War or the Motherland War
Adolf Hitler had generally described action in the "East" in Mein Kampf. It appears to always have been in his mind, but Germany was in no position to attack for many years. Indeed, there was considerable cooperation between Germany and the Soviet Union, the latter providing training for the Black Reichswehr while Germany was limited in military forces. Detailed German planning began in 1940.
Newly released documents lead recent historians to believe, however, that Stalin was planning a preemptive strike. "Though no smoking gun has been found in the archives yet — no document signed by Stalin naming the date of the attack — the new evidence demonstrates that the leader of the Soviet people started planning as early as the summer of 1940 and hoped to launch the invasion. "
Detailed planning was done by the Army Staff, OKH. One of the earliest notes during the planning process is an entry in the diary of Army Chief of Staff Franz Halder, for 31 July 1940. It described a first phase of a combined thrust toward Kiev, and a thrust through the Baltic States to Moscow. This would be followed by pincers from north and south, then an operation against the Baku oil fields in the Caucasus (now Azerbaijan).
Hitler issued OKW Directive 18 on 12 November 1940, confirming the Army staff was developing the plan and OKW was minimally involved. OKH presented their plans to him on 5 December, which he approved in principle. At that point, OKW became involved, and Warlimont provided a draft directive on 16 December. 
The formal decision came on 18 November 1940, with OKW Directive 21. A plan previously code-named "Otto" and "Fritz" was renamed "Barbarossa", with the order beginning
The German Wehrmacht must be prepared, also before the ending of the war against England, to crush Soviet Russia in a rapid campaign.
Plans would change during the operation.
Hitler and Mussolini met on 2 June. The two talked for two hours before being joined by their Foreign Ministers, Ribbentrop and Ciano. Mussolini noted that Hitler had wept over Hess' actions. After the ministers joined them, Hitler reviewed international issues, describing Britain as closer to political collapse, ruling out the invasion of Cyprus that Mussolini wanted, and again mentioned the Madagascar Plan with respect to ridding Europe of Jews. He did not, however, give any indication he was planning action, in the near term, against Russia.
More specific information was given to the Japanese Ambassador, a hint that Germany would act soon against the Soviets. On 12 June, however, he gave the broad plan to Romanian dictator Ion Antonescu, from whom he needed troops for the Russian front. Ionescu gave full support, and would call it a "Holy War" on the 22nd. 
Failure to prepare
Both Stalin and Adolf Hitler, in various ways, were unprepared for the reality of the conflict. Stalin was surprised, tactically and strategically, by the invasion. Hitler was overconfident in a quick victory.
Stalin received a warning document, in May 1939, about The Future Plans of Aggression by Fascist Germany, based on a German briefing obtained by Soviet spies in Warsaw. A Soviet agent first reported that Hitler planned to declare war on the Soviet Union in March 1941, and refined the estimate, by February 28, to May 20.
This intelligence was corroborated by sources in Bucharest, Budapest, Sofia and Rome, to say nothing of the information provided by the spy Richard Sorge (code-named Ramsay) in Tokyo  in which the authors detail the undercover operations of the spy ring headed by Richard Sorge and Hotsumi Ozaki which transmitted highly secret information from Tokyo to the Soviet Union between 1933 and 1941. On April 17 a Prague informant predicted a German invasion in the second half of June. The precise date and time of the invasion were revealed by a reliable source in Berlin fully three days before the Germans attacked.
All of this Stalin ignored. Typically, he scrawled on the bottom of the Prague report: English provocation! Investigate! On May 19, Sorge predicted that 150 divisions were being readied by the Germans for an invasion of the Soviet Union. Stalin retorted with an expletive.
The result was that literally nothing was done to prepare for the German assault. Soviet planes were not camouflaged. Troops were not in defensive positions; indeed they were ordered not to occupy such positions, for fear of provoking the Germans.
Worse, Stalin had to the gathering storm with yet another purge of suspected threats to his own authority, having had shot Mikhail Tukhachevsky and:
- 2 of the other 5 Marshals
- 13 of the 15 army commanders (full generals) and 8 of the 9 equivalent admirals
- 50 of the 57 corps commanders
- 154 of the 186 division commanders
Soviet public position
On 13 June 1941, Moscow Radio broadcast a TASS report that appeared to be in Stalin's personal style. "to tear up the Pact and to undertake an attack on the USSR are without any foundation," and that such rumours were "clumsy propaganda by forces hostile to the USSR and Germany and interested in an extension of the war." 
Was Stalin planning an attack?
Initial order of battle
Both countries used a system that separated military districts from major operational commands. A military district was responsible for the support of military facilities located within it, and of troops permanently assigned to them. Since the Soviet Union had not mobilized operational commands at the time of the invasion, the border districts thus controlled the immediate response, until the Fronts, the Soviet equivalent of an army group, were activated. Military districts did not play a major role on the German side.
- Walter von Brauchitsch, Commander-in-Chief of the Army and effective theater commander
- Franz Halder, Chief of the Army General Staff