Extreme incidents can cause diverse and dynamic disruptions to active distribution networks (ADNs). Thus, ADN operators (DNOs) must plan to prepare for and adapt to changes in conditions to withstand and quickly recover from such disruptions. This article proposes a cooperative planning framework to design optimal microgrids (MGs) in smart ADNs integrated with virtual power plants (VPPs) to quickly reconfigure and recover during such events. The proposed framework has two parts: 1) optimal partitioning of ADNs with integrated VPPs into supply-sufficient MGs; and 2) the scheduling of the partitioned MGs. Since the VPPs are autonomous, a smart DNO and VPP interface and operating model for dynamic operating envelopes (DOEs) is proposed to quantify and integrate the supply capacity of VPPs in the operation of MGs. As part of this framework, three optimization models are formulated including VPP optimization, ADN partitioning, and a partitioned ADN scheduling model, where the uncertainty of renewables, loads, and prices is modeled as stochastic scenarios. In part one, the VPP optimization model quantifies the available supply of VPPs. Then, the ADN partitioning model derives the optimal MGs by utilizing the supply of VPPs and network resources. In part two, based on the available supply of VPPs, the partitioned ADN scheduling model derives a day-ahead schedule for the MGs and the DOEs for VPPs. VPPs can then reoptimize to maximize their export within the DOEs. Finally, the proposed framework is validated on IEEE 13 and 123 node test networks, and the results are presented.