This article studies an unmanned aerial vehicle (UAV)-enabled edge-cloud system, where UAV acts as a mobile edge computing (MEC) server interplaying with remote central cloud to provide computation services to ground terminals (GTs). The UAV-enabled edge-cloud system implements a virtualized network function, namely, mobile clone (MC), for each GT to help execute their offloaded tasks. Through such network function virtualization (NFV) implemented on top of the UAV-enabled edge-cloud system, GTs can have extended computation capability and prolonged battery lifetime. We aim to jointly optimize the allocation of resource and the UAV trajectory in the 3-D spaces to minimize the overall energy consumption of the UAV. The proposed solution, therefore, can extend the endurance of the UAV and support reliable MC functions for GTs. This article solves the complicated optimization problem through a block coordinate descent algorithm in an iterative way. In each iteration, the allocation of resource is modeled as a multiple constrained optimization problem given predefined UAV trajectory, which can be reformulated into a more tractable convex form and solved by successive convex optimization and Lagrange duality. Second, given the allocated resource, the optimization of the trajectory of rotary-wing/fixed-wing UAV can be formulated into a series of convex quadratically constrained quadratically program (QCQP) problems and solved by the standard convex optimization techniques. After the block coordinate descent algorithm converges to a prescribed accuracy, a high-quality suboptimal solution can be found. According to the simulation, the numerical results verify the effectiveness of our proposed solution in contrast to the baseline solutions.