File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
vm_supervisor/vm/firecracker Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -118,18 +118,22 @@ async def setup(self):
118118
119119 async def wait_for_init (self ) -> None :
120120 """Wait for the init process of the instance to be ready."""
121- if not self .vm_configuration :
122- raise ValueError ("The VM has not been configured yet" )
121+ assert (
122+ self .enable_networking and self .tap_interface
123+ ), f"Network not enabled for VM { self .vm_id } "
124+
125+ ip = self .get_vm_ip ()
126+ if not ip :
127+ raise ValueError ("Host IP not available" )
123128
124- if not self .vm_configuration .ip :
125- raise ValueError ("VM IP address not set" )
129+ ip = ip .split ("/" , 1 )[0 ]
126130
127- attempts = 5
131+ attempts = 10
128132 timeout_seconds = 1.0
129133
130134 for attempt in range (attempts ):
131135 try :
132- await ping (self . vm_configuration . ip , packets = 1 , timeout = timeout_seconds )
136+ await ping (ip , packets = 1 , timeout = timeout_seconds )
133137 return
134138 except HostNotFoundError :
135139 if attempt < (attempts - 1 ):
You can’t perform that action at this time.
0 commit comments