Um, trivial? I suppose trivial is in the eyes of the beholder.
The equation dot(Z1,Y1) == 0 implies that Y1 lies in a plane in R^3, one that contains the origin. (That dot product is the orthogonality requirement.)
Next, the requirement that Y1 has unit length is just the equation of a sphere, with center at the origin.
The intersection of the sphere and plane will always be a unit circle, that lies in the plane of interest. You can parameterize that circle as a function of polar angle, in the rotated coordinate system.
So all you need do is choose a random point on the circle, one that satisfies the requirements on x,y,z. The constraints are just a constraint that specifies which octant the point can lie in. All of this can be done simply enough, if you understand how to transform the problem by rotating into the plane of interest. For example...
I would refuse to name the vectors Z1 and Y1, by the way. That is just poor coding practice, screaming to see you have bugs later on. You have a vector Z1, with elements [x1,y1,z1]? Then another vector named Y1, with elements [x2,y2,z2]? This is just asking for bugs. A bad idea. Learn to use more descriptive variable names. Your code will improve.