VMware: spawn refactor (partial)
A structured refactor of the vmwareapi spawn method to improve maintainability of the driver. Introduce
Goal: break up spawn method into reusable components
Phase 1: break out the nested inner methods to create components
Phase 2: introduce vmware image objects for validation and convenience
Phase 3: introduce image handler methods for image manipulation
Blueprint information
- Status:
- Complete
- Approver:
- John Garbutt
- Priority:
- High
- Drafter:
- Shawn Hartsock
- Direction:
- Approved
- Assignee:
- Shawn Hartsock
- Definition:
- Approved
- Series goal:
- Accepted for juno
- Implementation:
- Implemented
- Milestone target:
- 2014.2
- Started by
- Shawn Hartsock
- Completed by
- Michael Still
Related branches
Related bugs
Sprints
Whiteboard
See proposal: https:/
For design discussion see:
https:/
A note on review order:
All patches will be part of one of 3 phases based on their comment. Review in order of phase.
phase 1
These patches could actually be all independent, but this order is known to work.
* https:/
* https:/
* https:/
* https:/
* https:/
* https:/
phase 2
* additional refactoring, mostly of code leading up to gathering
image information and building a brand new virtual machine. See Phase 2 patches below
phase 3
The high branching factor in the second half of the spawn code
is a result of inefficient attempts to address various permutations of the following:
- different types image to spawn with (sparse, flat, iso,
streamOpt
- different ways to obtain the image (http download, datastore copy,
direct use, ...)
- different ways to prepare the downloaded image bits into a usable
image in the image cache (replace -flat.vmdk extent, convert from
sparse, pick from imported VM, ...)
- different ways to employed the image that has made available (fully
copy, as base of COW disk, direct use, ...)
This patch attempts to tease apart into three main areas of
responsibil
- ImageHandler classes : for obtaining bits of various kinds of images
- ImageProcessor classes : for processing the bits into a usable form to
- Image user callbacks : for dealing with using a prepared/cached image
The hope is that this will allow for more self-contained additions/changes
to behaviors in these areas, as well as more avenues to test different
aspects of the spawn operation in isolation.
-------
Phase 1 patches (all merged)
Gerrit topic: https:/
Addressed by: https:/
VMware: spawn refactor - phase 1 - get_vif_info
Addressed by: https:/
Propose: VMware spawn refactor
Addressed by: https:/
VMware: spawn refactor - phase 1 - execute_create_vm
Gerrit topic: https:/
Addressed by: https:/
VMWare: spawn refactor - phase 1 - _power_on_vm
Gerrit topic: https:/
Addressed by: https:/
Propose: VMware ephemeral disk support
Addressed by: https:/
VMWare: spawn refactor - phase 1 - create_virtual_disk
Addressed by: https:/
VMware: spawn refactor - phase 1 - fetch_image
Addressed by: https:/
VMware: spawn refactor - phase 1 - copy_virtual_disk
We are aiming for Juno-1 with this, based on previous conversations, so setting target milestone --johnthetubaguy (28th April 2014)
Now code is upload, target milestone is set, and url is correct, I have approved this --johnthetubaguy (28th April 2014)
Addressed by: https:/
VMware: spawn refactor - phase 1 - test for spawn
Addressed by: https:/
VMware: power_off_vm support
Given the code currently up for review, I can't see us getting all the code up for review and in over the next two weeks, so I am moving this to Juno-2. Seems like the coding of this is talking longer than expected? --johnthetubaguy (30th May 2014)
Phase 2 patches:
MERGED:
Addressed by: https:/
VMware: create utility functions
Addressed by: https:/
VMware: spawn refactor - DatastorePath class
Gerrit topic: https:/
Addressed by: https:/
VMware: validation descriptors for VMwareImage
Addressed by: https:/
VMware: remove unused parameters in imagecache
Addressed by: https:/
VMware: spawn refactor - Datastore class
Addressed by: https:/
VMware: remove dsutil.
Addressed by: https:/
VMware: refactor get_datastore_
Addressed by: https:/
VMware: consolidate datastore code
Addressed by: https:/
VMware: DatastorePath join() and __eq__()
Addressed by: https:/
VMware: use datastore classes get_allowed_
Addressed by: https:/
VMware: use datastore classes in file_move/delete, mkdir
Gerrit topic: https:/
Addressed by: https:/
VMware: Pass vm_ref to attach_root_volume if we have it
Addressed by: https:/
VMware: Trivial indentation cleanups in vmops
Addressed by: https:/
VMware: Convert vmops to use instance as an object
Addressed by: https:/
VMware: Consolidate fake_session in test_(vm|ds)_util
Addressed by: https:/
VMware: Remove unnecessary deepcopy()s in test_configdrive
----
Phase 2 patches still under review
Addressed by: https:/
VMware: Create VMwareImage object for image metadata
Addressed by: https:/
VMware: Use ds_util.
Addressed by: https:/
VMware: Remove references to ebs_root from spawn()
Addressed by: https:/
VMware: refactor spawn() code to build a new VM
Addressed by: https:/
VMware: test_driver_api: Use local variables in closures
Addressed by: https:/
VMware: Create fake VM with given datastore
Addressed by: https:/
VMware: Add _create_
Addressed by: https:/
VMware: Fix type of VM's config.
Phase 3 patches:
Addressed by: https:/
VMware: spawn refactor - image handling
Addressed by: https:/
VMware: spawn refactor _configure_
Addressed by: https:/
VMware: spawn refactor add VirtualMachineC
Addressed by: https:/
VMware: image user functions for spawn()
Addressed by: https:/
VMware: spawn refactor enlist image
Addressed by: https:/
VMware: deprecate usage of VMwareVCVMOps
Gerrit topic: https:/
Addressed by: https:/
Do_Not_Merge: use oslo.vmware
Addressed by: https:/
do_not_merge: use oslo.vmware
Gerrit topic: https:/
Addressed by: https:/
VMware: Remove get_copy_
Gerrit topic: https:/
Its almost impossible to tell whats happening from the gerrit topics here, need to dig into every change and see whats happening :( --johnthetubaguy 2nd September 2014
Apparently these are now left:
https:/
https:/
https:/
https:/
https:/
So all but the last patch are bouncing in and out of the gate, so staying in juno for now --johnthetubaguy 2nd September 2014
So, last patch is not making it into juno-3, but the others are in the gate now. --johnthetubaguy 3rd September 2014
Remaining code give -2 to help free up the gate a little bit of FF day. Now marked this as complete. --johnthetubaugy 4th September 2014
Addressed by: https:/
WIP: VMware: image fetch/cache functions
Addressed by: https:/
WIP : VMware add tests image fetch/cache fns
Addressed by: https:/
VMware: add tests for image fetch/cache functions
So last patches for FFE are:
https:/
https:/
https:/
--johnthetubaguy 8th September 2014
Gerrit topic: https:/
Work Items
Work items:
get_image_
get_vif_info (garyk): INPROGRESS
create_vm (maithem): INPROGRESS
_create_
_fetch_
_copy_virtual_disk (hartsocks): INPROGRESS
_power_on_vm (tjones): INPROGRESS
Address complex branching (vui): INPROGRESS
Dependency tree
* Blueprints in grey have been implemented.