Stress concentration around nanosized defects such as cavities always leads to plastic deformation and failure of solids. We investigate the effects of depth, size, and shape of a lotus-type nanocavity on onset plasticity of single crystal Al during nanoindentation on a (001) surface using a quasicontinuum method. The results show that the presence of a nanocavity can greatly affect the contact stiffness (Sc) and yield stress (σy) of the matrix during nanoindentation. For a circular cavity, the Sc and σy gradually increase with the cavity depth. A critical depth can be identified, over which the Sc and σy are insensitive to the cavity depth and it is firstly observed that the nucleated dislocations extend into the matrix and form a y-shaped structure. Moreover, the critical depth varies approximately linearly with the indenter size, regarding the same cavity. The Sc almost linearly decreases with the cavity diameter, while the σy is slightly affected. For an ellipsoidal cavity, the Sc and σy increase with the aspect ratio (AR), while they are less affected when the AR is over 1. Our results shed light in the mechanical behavior of metals with cavities and could also be helpful in designing porous materials and structures.