We numerically study the static configurations of pancake vortices in layered superconductors. We analyze how disordering induced by random pinning centers competes with inter-layer ordering and in-layer ordering. In general, for inter-layer ordering, 3D states composed of coupled vortex lines are formed for strong inter-layer coupling strength and weak pinning strength. In contrast, 2D states composed of decoupled individual pancake vortices are formed for weak inter-layer coupling strength and strong pinning strength. For in-layer ordering, with increasing pinning forces, the in-layer structure evolves from crystals to Bragg glasses (BGs), vortex glasses (VGs), and liquid-like structures. Changing the vortex density, an initially fast disordering, then slow ordering procedure is found for both in-layer and inter-layer ordering, which is a possible clue to second peak effect (SPE). The reason behind this non-monotonic behavior is discussed. Our results are summarized in a phase diagram in the plane of ‘inter-layer coupling strength sm versus pinning strength fp.