Existing resource management solutions in datacenters and cloud systems typically treat VMs as black boxes when making resource allocation decisions. This paper advocates the cooperation between VM host- and guest-layer schedulers for optimizing the resource management and application performance. It presents an approach to such cross-layer optimization upon fuzzy-modelingbased resource management. This approach exploits guest-layer application knowledge to capture workload characteristics and improve VM modeling, and enables the host-layer scheduler to feedback resource allocation decision and adapt guest-layer application configuration. As a case study, this approach is applied to virtualized databases which have challenging dynamic, complex resource usage behaviors. Specifically, it characterizes query workloads based on a database's internal cost estimation and adapts query executions by tuning the cost model parameters according to changing resource availability. A prototype of the proposed approach is implemented on Xen VMs and evaluated using workloads based on TPC-H and RUBiS. The results show that with guest-to-host workload characterization, resources can be efficiently allocated to database VMs serving workloads with changing intensity and composition while meeting Quality-of- Service (QoS) targets. For TPC-H, the prediction error for VM resource demand is less than 3.5%; for RUBiS, the response time target is met for 92% of the time. Both significantly outperform the resource allocation scheme without workload characterization. With host-to-guest database adaptation, the performance of TPCH- based workloads is also improved by 17% when the VM's available I/O bandwidth is reduced due to contention.