@@ -492,6 +492,14 @@ def create_vm(self, args) -> None:
492492
493493 envs = parse_env_file (args .env_file )
494494
495+ # Read user config file if provided
496+ user_config = ""
497+ if args .user_config :
498+ if not os .path .exists (args .user_config ):
499+ raise Exception (f"User config file not found: { args .user_config } " )
500+ with open (args .user_config , 'r' ) as f :
501+ user_config = f .read ()
502+
495503 # Create VM request
496504 params = {
497505 "name" : args .name ,
@@ -501,9 +509,11 @@ def create_vm(self, args) -> None:
501509 "memory" : args .memory ,
502510 "disk_size" : args .disk ,
503511 "app_id" : args .app_id ,
512+ "user_config" : user_config ,
504513 "ports" : [parse_port_mapping (port ) for port in args .port or []],
505514 "hugepages" : args .hugepages ,
506515 "pin_numa" : args .pin_numa ,
516+ "stopped" : args .stopped ,
507517 }
508518
509519 if args .ppcie :
@@ -884,6 +894,8 @@ def main():
884894 '--disk' , type = parse_disk_size , default = 20 , help = 'Disk size (e.g. 1G, 100M)' )
885895 deploy_parser .add_argument (
886896 '--env-file' , help = 'File with environment variables to encrypt' , default = None )
897+ deploy_parser .add_argument (
898+ '--user-config' , help = 'Path to user config file' , default = None )
887899 deploy_parser .add_argument ('--app-id' , help = 'Application ID' , default = None )
888900 deploy_parser .add_argument ('--port' , action = 'append' , type = str ,
889901 help = 'Port mapping in format: protocol[:address]:from:to' )
@@ -899,6 +911,8 @@ def main():
899911 help = 'KMS URL' )
900912 deploy_parser .add_argument ('--gateway-url' , action = 'append' , type = str ,
901913 help = 'Gateway URL' )
914+ deploy_parser .add_argument ('--stopped' , action = 'store_true' ,
915+ help = 'Create VM in stopped state (requires dstack-vmm >= 0.5.4)' )
902916
903917 # Images command
904918 _images_parser = subparsers .add_parser (
0 commit comments