Skip to content

Commit 8951149

Browse files
committed
Update volume-backed comment in _validate_flavor_image_nostatus
This clarifies and updates the big comment in the volume-backed case in the _validate_flavor_image_nostatus method since the method is called by more than just server create. The method is definitely tightly coupled with what calls it, so this tries to clarify that. Change-Id: I4b56458767e2712ad812db3b0901807d2c4aa848
1 parent 8aae3e3 commit 8951149

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

nova/compute/api.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,18 @@ def _validate_flavor_image_nostatus(context, image, instance_type,
602602

603603
# Target disk is a volume. Don't check flavor disk size because it
604604
# doesn't make sense, and check min_disk against the volume size.
605-
if (root_bdm is not None and root_bdm.is_volume):
606-
# There are 2 possibilities here: either the target volume already
607-
# exists, or it doesn't, in which case the bdm will contain the
608-
# intended volume size.
605+
if root_bdm is not None and root_bdm.is_volume:
606+
# There are 2 possibilities here:
607+
#
608+
# 1. The target volume already exists but bdm.volume_size is not
609+
# yet set because this method is called before
610+
# _bdm_validate_set_size_and_instance during server create.
611+
# 2. The target volume doesn't exist, in which case the bdm will
612+
# contain the intended volume size
613+
#
614+
# Note that rebuild also calls this method with potentially a new
615+
# image but you can't rebuild a volume-backed server with a new
616+
# image (yet).
609617
#
610618
# Cinder does its own check against min_disk, so if the target
611619
# volume already exists this has already been done and we don't

0 commit comments

Comments
 (0)