On the surface, the game of musical chairs being played this week in President Obama’s Cabinet seems intended to elevate the star of San Antonio Mayor Julián Castro, who is being nominated to lead the Department of Housing and Urban Development and is seen as a potential vice-presidential candidate in 2016 or beyond.

But it also involves a set of decisions that sheds light on Obama’s thinking about his team heading into the final two years of his administration.

HUD Secretary Shaun Donovan, rather than leaving the administration after six years, now seems destined to stay for the duration as he moves into the job of Office of Management and Budget director. Exiting that role is Sylvia Mathews Burwell, whose nomination to lead the Department of Health and Human Services is moving swiftly though the Senate.

The moves seem to be largely about bringing Donovan into Obama’s inner circle. OMB isn’t a distant Cabinet agency. It plays a role in nearly every aspect of the administration’s actions. Its director is among the president’s closest advisers.

And while recent OMB directors may not have been high-profile figures, the office has been run by prominent figures such as Leon Panetta, David Stockman, and Caspar Weinberger in years past.

Some people close to the White House were surprised by the personnel changes. Donovan has had little exposure to the world of budget wonks. With the housing market still weak and big legislative battles on housing looming, it might have made sense to keep Donovan, a lifelong housing advocate, at HUD.

Alternative arrangements were certainly available. Rather than sending Burwell to HHS, Obama could have chosen businessman Jeff Zients, his new director of the National Economic Council, who last fall rescued Healthcare.gov.

Or if the choice was made that Burwell had the easiest path to confirmation, Zients could also have gone to OMB, where he was acting director in 2012.

Deputy OMB Director Brian Deese, a wunderkind adviser who helped design the auto industry rescue and played a key role in many administration economic decisions, could easily have been elevated to lead OMB or the National Economic Council.

Any of these moves would have probably been more seamless — and more obvious — than what Obama is doing. But that he is going to such lengths to move Donovan into the White House’s inner orbit says a lot about the team he wants in his final two years, and what he expects its members will do.

At HUD, Donovan has become expert in using the administration’s executive authority to pursue policies rather than relying on legislative action. He has been a central force behind the administration’s foreclosure prevention policies and efforts to expand access to mortgage credit for credible borrowers.

“Shaun has earned a reputation as a great manager, a fiscally responsible leader and somebody who knows how the decisions we make here in Washington affect people’s lives all across the country,” Obama said in remarks Friday.

He is well-liked by liberal and civil rights groups that often have the White House in their firing line. Donovan also has had key roles in lesser-known administration efforts that are important to Obama, such as providing aid to bankrupt Detroit or developing “promise zones” to concentrate resources in the country’s most impoverished areas.

As Obama looks to his final two years — a period in which he is not likely to have a compliant Congress — he will need to increasingly rely on executive actions that stretch the limits of his authority. He’ll probably want to push in more liberal directions on issues such as climate change, immigration, civil rights, poverty and the economy.

With Donovan at OMB, Obama is likely to have someone who is willing to be a partner in such efforts at a time when the administration is losing those most adept at formulating executive actions.

Gene Sperling, former National Economic Council director, left several months ago. And John Podesta, who for years as president of the Center of American Progress had urged Obama to embrace a more muscular view of executive power, is halfway through his one-year tenure as a White House counselor.

With the odds of grand legislative achievement low, Obama has hinted that he wants to use the remainder of his second term to focus in part on the challenges facing low-income communities — and the tangled intersection of race, poverty and crime that any new policies will need to address.

Housing is a testing ground for many of those debates, and it’s where Donovan has been working for most of his career. So at least on that level, it makes sense that Obama wants to bring him closer to the White House.

“Few had a tougher job than Shaun Donovan. The housing bubble that burst triggered the worst economic crisis of our lifetimes — and the irresponsibility of a few bad actors badly hurt millions of responsible, hardworking Americans,” Obama said. “And five years later, things look a lot different. . . . While we’re not anywhere near where we need to be yet, millions of families have been able to come up for air because they’re no longer underwater on their mortgages.”