How to Enable VPC Flow Logs for Subnet-2 in Shared VPC?
Short answer
B Configure VPC Flow Logs in the service project VPC for Subnet-2.
Question

Key Takeaways
Examines the boundary between host and service project networking, testing whether candidates recognize that flow logs are scoped to individual VPCs rather than automatically aggregated across Shared VPC hierarchies.
Configuring VPC Flow Logs requires enabling logging at the specific VPC level where traffic originates. Community consensus confirms that since Subnet-2 resides in a separate service project VPC, flow logs must be explicitly configured there rather than relying on host project settings.
Common mistake: Option A is the most frequent incorrect choice, stemming from a misinterpretation of Google Cloud documentation regarding host-project log consolidation; this rule only applies when subnets are actually attached to the host VPC, not to independent service project networks.
Expert Analysis
Why the Answer Is Correct
VPC Flow Logs operate at the VPC network level, meaning each distinct VPC requires its own logging configuration. Since Subnet-2 is located in a separate service project VPC, enabling flow logs there directly captures its traffic metadata. This approach aligns with Google Cloud architecture where logging scope matches the VPC boundary, ensuring accurate monitoring for resources outside the host project.
Why the Other Options Are Wrong
Option A fails because filtering alone cannot generate logs for a VPC where logging is disabled, and cross-project filtering does not bypass the initial collection requirement. Option C introduces Packet Mirroring, which duplicates raw packets for analysis rather than collecting structured flow metadata efficiently. Option D modifies firewall rules, which controls traffic allowance but has no impact on logging collection or visibility.
Community Comment Notes
Multiple candidates highlighted that the diagram depicts two entirely separate VPCs, confirming that Subnet-2 belongs to the service project network. Commenters noted that compute instances cannot span multiple VPCs within the same project, reinforcing the architectural separation. While some cited official documentation about host-project log consolidation, others clarified that this rule strictly applies to subnets actually provisioned under the host VPC, not independent service networks.
Official Reference
- https://cloud.google.com/vpc/docs/flow-logs#vm-to-vm-flows-shared-vpc
- https://cloud.google.com/vpc/docs/using-flow-logs
- https://cloud.google.com/vpc/docs/shared-vpc
These links open the official vendor documentation in a new tab.
Exam Strategy
Always verify which project owns the VPC containing your target subnet before selecting logging options. Remember that VPC Flow Logs must be enabled at the network level first, as filters or mirroring are secondary configurations that cannot replace initial logging activation.
Community Votes
62% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 9 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 9
-
Cris0303 👍 8A compute engine can't have multiple NICs in the same VPC, so in the figure the VPCs are two (even if with the same name), one in the host project and one in the service project. So the answer is B
-
PeppaPig 👍 4B is right Those are two separate VPCs
-
gonlafer 👍 2 Answered AIt's A. https://cloud.google.com/vpc/docs/flow-logs#vm-to-vm-flows-shared-vpc
-
zzaric 👍 1It's B. Service project has it's own VPC where the Subnet-2 is located and it has nothing to do with Host Project and Shared VPC. If the Subnet-2 was the part of Host project Shared VPC then correct answer would be B.
-
[Removed] 👍 1 Answered A"In Shared VPC networks, logs only appear in the host project, not the service projects. Make sure you look for the logs in the host project." https://cloud.google.com/vpc/docs/using-flow-logs I go with A
Show 4 more comments
-
desertlotus1211 👍 1A Shared VPC network is a VPC network defined in a host project and made available as a centrally shared network for eligible resources in service projects
-
anshad666 👍 1 Answered BA compute engine can't have multiple NICs in the same VPC
-
d07d3be 👍 2 Answered BB is correct
-
nkastanas 👍 1 Answered Bagree its B
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All PCNE Questions
Access 80 questions with complete answers and detailed explanations.
View Full PCNE Practice Test →