 < ? x m l   v e r s i o n = " 1 . 0 "   e n c o d i n g = " I S O - 8 8 5 9 - 1 "   s t a n d a l o n e = " y e s " ? > 
 < d u n e s - s c r i p t - m o d u l e   n a m e = " g e t R e l o c a t e S p e c "   r e s u l t - t y p e = " A n y "   a p i - v e r s i o n = " 3 . 1 . 0 "     i d = " 8 1 8 0 8 0 8 0 8 0 8 0 8 0 8 0 8 0 8 0 8 0 8 0 8 0 8 0 8 0 8 0 D E 8 6 8 0 8 0 0 1 3 0 6 7 7 3 4 2 4 2 6 7 a 2 c 0 d a e 5 6 b b "     v e r s i o n = " 0 . 2 . 0 "     a l l o w e d - o p e r a t i o n s = " v f "   > < d e s c r i p t i o n > < ! [ C D A T A [ S p e c i f i c a t i o n   f o r   m o v i n g   o r   c o p y i n g   a   v i r t u a l   m a c h i n e   t o   a   d i f f e r e n t   d a t a s t o r e   o r   h o s t .   ] ] > < / d e s c r i p t i o n > 
 < p a r a m   n = " d a t a s t o r e "   t = " V C : D a t a s t o r e " > < ! [ C D A T A [ [ o p t i o n a l ]   T h e   d a t a s t o r e   w h e r e   t h e   v i r t u a l   m a c h i n e   s h o u l d   b e   l o c a t e d .   I f   n o t   s p e c i f i e d ,   t h e   c u r r e n t   d a t a s t o r e   i s   u s e d ] ] > < / p a r a m > < p a r a m   n = " d i s k "   t = " A r r a y / A n y " > < ! [ C D A T A [ [ o p t i o n a l ]   A r r a y   o f   V i r t u a l M a c h i n e R e l o c a t e S p e c D i s k L o c a t o r :   A n   o p t i o n a l   l i s t   t h a t   a l l o w s   s p e c i f y i n g   t h e   d a t a s t o r e   l o c a t i o n   f o r   e a c h   v i r t u a l   d i s k . ] ] > < / p a r a m > < p a r a m   n = " h o s t "   t = " V C : H o s t S y s t e m " > < ! [ C D A T A [ [ o p t i o n a l ]   T h e   t a r g e t   h o s t   f o r   t h e   v i r t u a l   m a c h i n e . ] ] > < / p a r a m > < p a r a m   n = " p o o l "   t = " V C : R e s o u r c e P o o l " > < ! [ C D A T A [ [ o p t i o n a l ]   T h e   r e s o u r c e   p o o l   t o   w h i c h   t h i s   v i r t u a l   m a c h i n e   s h o u l d   b e   a t t a c h e d .   ] ] > < / p a r a m > < p a r a m   n = " t r a n s f o r m "   t = " V C : V i r t u a l M a c h i n e R e l o c a t e T r a n s f o r m a t i o n " > < ! [ C D A T A [ [ o p t i o n a l ]   T r a n s f o r m a t i o n   t o   p e r f o r m   o n   t h e   d i s k s .   ] ] > < / p a r a m > < s c r i p t   e n c o d e d = ' f a l s e ' > < ! [ C D A T A [ t r y   { 
 	 s i m p l e C h e c k P a r a m s ( ) ; 
 	 c o n s i s t e n c y C h e c k P a r a m s ( ) ; 
 	 v a r   r e l o c a t e S p e c   =   n e w   V c V i r t u a l M a c h i n e R e l o c a t e S p e c ( ) ; 
 	 a f f e c t P a r a m s ( ) ; 
 	 r e t u r n   r e l o c a t e S p e c ; 
 } 
 c a t c h   ( e x )   { 
 	 t h r o w   " U n a b l e   t o   c r e a t e   V c V i r t u a l M a c h i n e R e l o c a t e S p e c :   "   +   e x ; 
 } 
 
 f u n c t i o n   c o n s i s t e n c y C h e c k P a r a m s ( )   { 
 	 / / i f   r e s o u r c e   p o o l   i s   n o t   s p e c i f i e d ,   c u r r e n t   h o s t   i s   u s e d .   
 	 i f   ( p o o l   = =   n u l l   & &   h o s t   = =   n u l l )   r e t u r n ;   / /   t h r o w   " p o o l   a n d   h o s t   c a n n o t   b e   a l l   t w o   s e t   t o   n u l l " ; 
 	 i f   ( p o o l   = =   n u l l )   { 
 	 	 c h e c k D a t a s t o r e A c c e s s O k F r o m H o s t ( h o s t ) ; 
 	 } 
 	 e l s e   { 
 	 	 c l u s t e r   =   p o o l . p a r e n t ; 
 	 	 w h i l e   ( !   ( c l u s t e r   i n s t a n c e o f   V c C o m p u t e R e s o u r c e )   & &   !   ( c l u s t e r   i n s t a n c e o f   V c C l u s t e r C o m p u t e R e s o u r c e ) )   { 
 	 	 	 c l u s t e r   =   c l u s t e r . p a r e n t ; 
 	 	 } 
 	 	 / / i f   r e s o u r c e   p o o l   i s   s p e c i f i e d ,   a n d   t h e   t a r g e t   p o o l   r e p r e s e n t s   a   s t a n d - a l o n e   h o s t ,   t h e   h o s t   i s   u s e d .   
 	 	 i f   ( c l u s t e r   i n s t a n c e o f   V c C o m p u t e R e s o u r c e )   { 
 	 	 	 i f   ( h o s t   ! =   n u l l   & &   ( c l u s t e r   ! =   h o s t . p a r e n t ) )   { 
 	 	 	 	 t h r o w   " p o o l   a n d   h o s t   d o   n o t   r e p r e s e n t   t h e   s a m e   c o m p u t e   r e s o u r c e " ; 
 	 	 	 } 
 	 	 } 
 	 	 e l s e   i f   ( c l u s t e r   i n s t a n c e o f   V c C l u s t e r C o m p u t e R e s o u r c e )   { 
 	 	 	 i f   ( c l u s t e r . c o n f i g u r a t i o n . d r s C o n f i g . e n a b l e d   )   { 
 	 	 	 	 / / i f   r e s o u r c e   p o o l   i s   s p e c i f i e d ,   a n d   t h e   t a r g e t   p o o l   r e p r e s e n t s   a   D R S - e n a b l e d   c l u s t e r ,   a   h o s t   s e l e c t e d   b y   D R S   i s   u s e d .   
 	 	 	 	 i f   ( h o s t   ! =   n u l l   & &   ( c l u s t e r   ! =   h o s t . p a r e n t ) )   { 
 	 	 	 	 	 t h r o w   " p o o l   a n d   h o s t   d o   n o t   r e p r e s e n t   t h e   s a m e   c o m p u t e   r e s o u r c e " ; 	 	 	 	 	 	 
 	 	 	 	 } 
 	 	 	 } 
 	 	 	 e l s e   { 
 	 	 	 / / i f   r e s o u r c e   p o o l   i s   s p e c i f i e d   a n d   t h e   t a r g e t   p o o l   r e p r e s e n t s   a   c l u s t e r   w i t h o u t   D R S   e n a b l e d ,   a n   I n v a l i d A r g u m e n t   e x c e p t i o n   b e   t h r o w n .   	 
 	 	 	 	 i f   ( h o s t   = =   n u l l )   { 
 	 	 	 	 	 t h r o w   " p o o l   i s   i n   a   c l u s t e r   w i t h o u t   d r s .   Y o u   m u s t   d e f i n e   h o s t " ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 	 } 
 } 
 
 f u n c t i o n   c h e c k D a t a s t o r e A c c e s s O k F r o m H o s t ( m y H o s t )   { 
 	 v a r   a l l D S   =   m y H o s t . d a t a s t o r e ; 
 	 v a r   f o u n d   =   f a l s e ; 
 	 
 	 i f   ( d a t a s t o r e   = =   n u l l )   { 
 	 	 r e t u r n ; 
 	 } 
 	 
 	 f o r   ( v a r   i   i n   a l l D S )   { 
 	 	 i f   ( a l l D S [ i ]   = =   d a t a s t o r e )   { 
 	 	 	 f o u n d   =   t r u e ; 
 	 	 	 b r e a k ; 
 	 	 } 
 	 } 
 	 i f   ( f o u n d   = =   f a l s e )   { 
 	 	 v a r   h o s t N a m e   =   m y H o s t   = =   n u l l   ?   " U n k n o w n   H o s t "   :   m y H o s t . n a m e ; 
 	 	 v a r   d a t a s t o r e N a m e   =   d a t a s t o r e   = =   n u l l   ?   " U n k n o w n   D a t a s t o r e "   :   d a t a s t o r e . n a m e ; 
 	 	 t h r o w   " h o s t   "   +   h o s t N a m e   +   "   h a v e   n o   a c c e s s   t o   d a t a s t o r e   "   +   d a t a s t o r e N a m e ; 
 	 } 
 } 
 
 f u n c t i o n   c h e c k D a t a s t o r e A c c e s s O k F r o m C l u s t e r ( m y C l u s t e r )   { 
 	 v a r   a l l D S   =   m y C l u s t e r . d a t a s t o r e ; 
 	 v a r   f o u n d   =   f a l s e ; 
 	 
 	 i f   ( d a t a s t o r e   = =   n u l l )   { 
 	 	 r e t u r n ; 
 	 } 
 	 
 	 f o r   ( v a r   i   i n   a l l D S )   { 
 	 	 i f   ( a l l D S [ i ]   = =   d a t a s t o r e )   { 
 	 	 	 f o u n d   =   t r u e ; 
 	 	 	 b r e a k ; 
 	 	 } 
 	 } 
 	 i f   ( f o u n d   = =   f a l s e )   { 
 	 	 v a r   c l u s t e r N a m e   =   m y C l u s t e r   = =   n u l l   ?   " U n k n o w n   C l u s t e r "   :   m y C l u s t e r . n a m e ; 
 	 	 v a r   d a t a s t o r e N a m e   =   d a t a s t o r e   = =   n u l l   ?   " U n k n o w n   D a t a s t o r e "   :   d a t a s t o r e . n a m e ; 	 	 
 	 	 t h r o w   " c l u s t e r   "   +   c l u s t e r N a m e   +   "   h a v e   n o   a c c e s s   t o   d a t a s t o r e   "   +   d a t a s t o r e N a m e ; 
 	 } 
 } 
 
 f u n c t i o n   a f f e c t P a r a m s ( )   { 
 	 i f   ( d a t a s t o r e   ! =   n u l l ) 
 	 	 r e l o c a t e S p e c . d a t a s t o r e   =   d a t a s t o r e . r e f e r e n c e ; 
 	 i f   ( d i s k   ! =   n u l l   & &   d i s k . l e n g t h   >   0 )   
 	 	 r e l o c a t e S p e c . d i s k   =   d i s k ; 
 	 i f   ( h o s t   ! =   n u l l ) 
 	 	 r e l o c a t e S p e c . h o s t   =   h o s t . r e f e r e n c e ; 
 	 i f   ( p o o l   ! =   n u l l ) 
 	 	 r e l o c a t e S p e c . p o o l   =   p o o l . r e f e r e n c e ; 
 	 i f   ( t r a n s f o r m   ! =   n u l l ) 
 	 	 r e l o c a t e S p e c . t r a n s f o r m   =   V c V i r t u a l M a c h i n e R e l o c a t e T r a n s f o r m a t i o n . f r o m S t r i n g ( t r a n s f o r m . n a m e ) ; 
 } 
 
 
 f u n c t i o n   s i m p l e C h e c k P a r a m s ( )   { 
 	 i f   ( d i s k   ! =   n u l l )   { 
 	 	 f o r   ( v a r   i   i n   d i s k )   { 
 	 	 	 i f   ( ( d i s k [ i ]   i n s t a n c e o f   V c V i r t u a l M a c h i n e R e l o c a t e S p e c D i s k L o c a t o r )   = =   f a l s e )   { 
 	 	 	 	 t h r o w   " d i s k   m u s t   b e   o f   t y p e   ' A r r a y   o f   V c V i r t u a l M a c h i n e R e l o c a t e S p e c D i s k L o c a t o r ' " ; 
 	 	 	 } 
 	 	 } 
 	 } 
 } ] ] > < / s c r i p t > 
 < / d u n e s - s c r i p t - m o d u l e >