mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	This PR allows the cloud admin to set either a global or domain-specific value "metadata.allow.expose.domain", and when set this allows the VM to see the name and ID of the immediate domain that contains the VM in instance metadata. This can be useful or a variety of things such as bootstrapping VM configuration and access according to domain. This PR also deletes the CloudZonesNetworkElement because it isn't referred to anywhere, and there was initially some confusion as to whether this code needed to be updated when extending metadata. If it needs to be kept we can remove that delete from the PR. Signed-off-by: Marcus Sorensen <mls@apple.com> Co-authored-by: Marcus Sorensen <mls@apple.com> Co-authored-by: dahn <daan.hoogland@gmail.com> Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com>
		
			
				
	
	
		
			26 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			ApacheConf
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			ApacheConf
		
	
	
	
	
	
Options +FollowSymLinks
 | 
						|
RewriteEngine On
 | 
						|
 | 
						|
#http://<routerIP>/latest/user-data  and .../user-data/  (both yield user-data file)
 | 
						|
#http://<routerIP>/latest/meta-data and .../meta-data/   (dir listing of meta-data)
 | 
						|
RewriteRule ^user-data/?$  ../userdata/%{REMOTE_ADDR}/user-data [L,NC,QSA]
 | 
						|
RewriteRule ^meta-data/?$  ../metadata/%{REMOTE_ADDR}/meta-data [L,NC,QSA]
 | 
						|
 | 
						|
#http://<routerIP/latest/meta-data/foo and .../foo/  (yield metadata/$IP/foo)
 | 
						|
RewriteRule ^meta-data/(.+[^/])/?$  ../metadata/%{REMOTE_ADDR}/$1 [L,NC,QSA]
 | 
						|
 | 
						|
#http://<routerIP>/latest/foo and .../foo/ (yield metadata/$IP/foo)
 | 
						|
#are these used?
 | 
						|
RewriteRule ^availability-zone/?$  ../metadata/%{REMOTE_ADDR}/availability-zone [L,NC,QSA]
 | 
						|
RewriteRule ^cloud-identifier/?$  ../metadata/%{REMOTE_ADDR}/cloud-identifier [L,NC,QSA]
 | 
						|
RewriteRule ^instance-id/?$  ../metadata/%{REMOTE_ADDR}/instance-id [L,NC,QSA]
 | 
						|
RewriteRule ^local-hostname/?$  ../metadata/%{REMOTE_ADDR}/local-hostname [L,NC,QSA]
 | 
						|
RewriteRule ^local-ipv4/?$  ../metadata/%{REMOTE_ADDR}/local-ipv4 [L,NC,QSA]
 | 
						|
RewriteRule ^public-hostname/?$  ../metadata/%{REMOTE_ADDR}/public-hostname [L,NC,QSA]
 | 
						|
RewriteRule ^public-ipv4/?$  ../metadata/%{REMOTE_ADDR}/public-ipv4 [L,NC,QSA]
 | 
						|
RewriteRule ^public-keys/?$  ../metadata/%{REMOTE_ADDR}/public-keys [L,NC,QSA]
 | 
						|
RewriteRule ^service-offering/?$  ../metadata/%{REMOTE_ADDR}/service-offering [L,NC,QSA]
 | 
						|
RewriteRule ^vm-id/?$  ../metadata/%{REMOTE_ADDR}/vm-id [L,NC,QSA]
 | 
						|
RewriteRule ^cloud-domain/?$  ../metadata/%{REMOTE_ADDR}/vm-id [L,NC,QSA]
 | 
						|
RewriteRule ^cloud-domain-id/?$  ../metadata/%{REMOTE_ADDR}/vm-id [L,NC,QSA]
 |