'Attach a root volume to the VM instance.'

def attach_root_volume(self, connection_info, instance, datastore, adapter_type=None):

    driver_type = connection_info['driver_volume_type']
    LOG.debug('Root    volume    attach.    Driver    type:    %s', driver_type, instance=instance)
    if (driver_type == constants.DISK_FORMAT_VMDK):
        vm_ref = vm_util.get_vm_ref(self._session, instance)
        data = connection_info['data']
        volume_ref = self._get_volume_ref(data['volume'])
        res_pool = self._get_res_pool_of_vm(vm_ref)
        self._relocate_vmdk_volume(volume_ref, res_pool, datastore)
    self.attach_volume(connection_info, instance, adapter_type)
